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
2 changes: 2 additions & 0 deletions .github/workflows/skillsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- ".claude/skills/**"
- ".cursor/skills/**"
- "src/**"
- "browser/**"
- "desktop/**"
- "scripts/**"
- "tests/**"
Expand Down Expand Up @@ -55,6 +56,7 @@ jobs:
- run: npm test
- run: npm test -- --run tests/integration/product-trust-loop.test.ts tests/integration/live-runtime-preparation.test.ts tests/docs/documentation.test.ts
- run: npm run type-check
- run: npm run build:browser
- run: npm run lint
- run: npm pack --dry-run
- name: Generate SBOM preview (non-blocking)
Expand Down
7 changes: 6 additions & 1 deletion browser/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ function check() {
input.value = example;
input.addEventListener("input",clear);
document.querySelector("#check")!.addEventListener("click",check);
document.querySelector("#example")!.addEventListener("click",()=>{input.value=example;clear();input.focus()});
document.querySelector("#example")!.addEventListener("click", () => {
if (input.value.trim() && input.value !== example && !window.confirm("用示例替换当前文档?")) return;
input.value = example;
clear();
input.focus();
});
12 changes: 12 additions & 0 deletions browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "..",
"lib": ["ES2022", "DOM"],
"types": [],
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true
},
"include": ["main.ts"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"check": "npm test && npm run type-check && npm run lint && npm run build",
"prepack": "npm run build",
"pretest": "npm run build",
"build:browser": "vite build browser --base ./ --outDir ../browser-dist --emptyOutDir"
"build:browser": "tsc -p browser/tsconfig.json && vite build browser --base ./ --outDir ../browser-dist --emptyOutDir"
},
"dependencies": {
"commander": "^13.1.0",
Expand Down
41 changes: 26 additions & 15 deletions tests/cli/test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { mkdir, mkdtemp, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";

import { describe, expect, it } from "vitest";
import { describe, expect, it, vi } from "vitest";
import { SpawnCommandRunner } from "../../src/sandbox/command";

import { runCli } from "../../src/cli/index";
import { publicAvailabilityFinding } from "../../src/cli/commands/test-v2";
Expand Down Expand Up @@ -320,20 +321,30 @@ describe("skillsync test", () => {
it("blocks Docker explicitly without fallback", async () => {
const root = await mkdtemp(join(tmpdir(), "skillsync-behavior-v2-docker-"));
const fixtureRoot = await createV2Fixture(root, "docker");
const result = await runCli([
"test",
"--fixture",
fixtureRoot,
"--execute",
"--backend",
"docker",
"--format",
"json",
]);

expect(result.exitCode).toBe(4);
expect(result.stdout).toMatch(/sandbox\.backend-unavailable/);
expect(JSON.parse(result.stdout).execution.status).toBe("blocked");
const hostCommand = vi.spyOn(SpawnCommandRunner.prototype, "run").mockResolvedValue({
exitCode: null, stdout: "", stderr: "", timedOut: true, outputLimitExceeded: false,
});
try {
const result = await runCli([
"test",
"--fixture",
fixtureRoot,
"--execute",
"--backend",
"docker",
"--format",
"json",
]);

expect(result.exitCode).toBe(4);
expect(result.stdout).toMatch(/sandbox\.backend-unavailable/);
expect(JSON.parse(result.stdout).execution.status).toBe("blocked");
expect(hostCommand.mock.calls.map(([spec]) => [spec.executable, ...spec.args])).toEqual([
["docker", "version", "--format", "{{.Server.Version}}"],
]);
} finally {
hostCommand.mockRestore();
}
});

it("returns code 2 for an invalid v2 manifest", async () => {
Expand Down
Loading