Skip to content
Open
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
7 changes: 7 additions & 0 deletions skills/oracle/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ Recommended defaults:
- Browser run (main path; long-running is normal):
- `npx -y @steipete/oracle --engine browser --model gpt-5.4-pro -p "<task>" --file "src/**"`

- Whole-repo browser upload (tracked archive; preferred when you want ChatGPT to inspect an entire repo):
- `cd /path/to/repo && git archive --format=zip --output /tmp/repo-tracked.zip HEAD`
- `npx -y @steipete/oracle --engine browser --browser-attachments always -p "<task>" --file /tmp/repo-tracked.zip`
- Notes:
- `git archive HEAD` includes tracked files only, so untracked junk like `node_modules`, `.next`, `dist`, and local logs stay out automatically.
- If you need extra excludes beyond tracked-file filtering, use git pathspecs or a repo-specific archive script; avoid brittle `grep` pipelines.

- Manual paste fallback (assemble bundle, copy to clipboard):
- `npx -y @steipete/oracle --render --copy -p "<task>" --file "src/**"`
- Note: `--copy` is a hidden alias for `--copy-markdown`.
Expand Down
4 changes: 4 additions & 0 deletions src/browser/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const MEDIA_EXTENSIONS = new Set([
".heic",
".heif",
".pdf",
".zip",
".tar",
".gz",
".7z",
]);

export function isMediaFile(filePath: string): boolean {
Expand Down
36 changes: 36 additions & 0 deletions tests/browser/prompt.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { describe, expect, test } from "vitest";
import { assembleBrowserPrompt } from "../../src/browser/prompt.js";
Expand Down Expand Up @@ -213,4 +215,38 @@ describe("assembleBrowserPrompt", () => {
bundlePath: result.attachments[0]?.displayPath,
});
});

test("treats zip archives as upload attachments", async () => {
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "oracle-zip-"));
const zipPath = path.join(tempDir, "repo-tracked.zip");
await fs.writeFile(zipPath, "fake zip payload");

try {
const result = await assembleBrowserPrompt(
buildOptions({
file: [zipPath],
browserAttachments: "always",
}),
{
cwd: "/repo",
readFilesImpl: async (paths) => {
expect(paths).toEqual([]);
return [];
},
},
);

expect(result.attachmentMode).toBe("upload");
expect(result.attachments).toEqual([
expect.objectContaining({
path: zipPath,
displayPath: path.relative("/repo", zipPath),
}),
]);
expect(result.composerText).toBe("Explain the bug");
expect(result.inlineFileCount).toBe(0);
} finally {
await fs.rm(tempDir, { recursive: true, force: true });
}
});
});