feat: enforce device-bound connect challenge
This commit is contained in:
@@ -18,14 +18,25 @@ type JsonSchema = {
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const repoRoot = path.resolve(__dirname, "..");
|
||||
const outPath = path.join(
|
||||
repoRoot,
|
||||
"apps",
|
||||
"macos",
|
||||
"Sources",
|
||||
"ClawdbotProtocol",
|
||||
"GatewayModels.swift",
|
||||
);
|
||||
const outPaths = [
|
||||
path.join(
|
||||
repoRoot,
|
||||
"apps",
|
||||
"macos",
|
||||
"Sources",
|
||||
"ClawdbotProtocol",
|
||||
"GatewayModels.swift",
|
||||
),
|
||||
path.join(
|
||||
repoRoot,
|
||||
"apps",
|
||||
"shared",
|
||||
"ClawdbotKit",
|
||||
"Sources",
|
||||
"ClawdbotProtocol",
|
||||
"GatewayModels.swift",
|
||||
),
|
||||
];
|
||||
|
||||
const header = `// Generated by scripts/protocol-gen-swift.ts — do not edit by hand\nimport Foundation\n\npublic let GATEWAY_PROTOCOL_VERSION = ${PROTOCOL_VERSION}\n\npublic enum ErrorCode: String, Codable, Sendable {\n${Object.values(ErrorCodes)
|
||||
.map((c) => ` case ${camelCase(c)} = "${c}"`)
|
||||
@@ -221,9 +232,11 @@ async function generate() {
|
||||
parts.push(emitGatewayFrame());
|
||||
|
||||
const content = parts.join("\n");
|
||||
await fs.mkdir(path.dirname(outPath), { recursive: true });
|
||||
await fs.writeFile(outPath, content);
|
||||
console.log(`wrote ${outPath}`);
|
||||
for (const outPath of outPaths) {
|
||||
await fs.mkdir(path.dirname(outPath), { recursive: true });
|
||||
await fs.writeFile(outPath, content);
|
||||
console.log(`wrote ${outPath}`);
|
||||
}
|
||||
}
|
||||
|
||||
generate().catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user