bit-office 0.1.7 → 0.1.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/dist/index.js +22 -9
- package/dist/index.js.map +1 -1
- package/dist/web/out/404.html +2 -2
- package/dist/web/out/_next/static/chunks/904.4649cb92e3c1355c.js +1 -0
- package/dist/web/out/_next/static/chunks/app/office/page-75459bb9d7bfe004.js +1 -0
- package/dist/web/out/_next/static/chunks/{webpack-1075fa19d83199c2.js → webpack-131b3d260a3d9ce4.js} +1 -1
- package/dist/web/out/index.html +2 -2
- package/dist/web/out/index.txt +1 -1
- package/dist/web/out/office.html +2 -2
- package/dist/web/out/office.txt +2 -2
- package/dist/web/out/pair.html +2 -2
- package/dist/web/out/pair.txt +1 -1
- package/dist/web/out/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/out/_next/static/chunks/904.8b3ff312a1556d6a.js +0 -1
- package/dist/web/out/_next/static/chunks/app/office/page-576a0f6864a5fc48.js +0 -1
- /package/dist/web/out/_next/static/{QSSYYk4eRRYqGdbhctTgP → sIGb0dLMKfsNQk_o2W3je}/_buildManifest.js +0 -0
- /package/dist/web/out/_next/static/{QSSYYk4eRRYqGdbhctTgP → sIGb0dLMKfsNQk_o2W3je}/_ssgManifest.js +0 -0
package/dist/index.js
CHANGED
|
@@ -4287,7 +4287,8 @@ function buildConfig() {
|
|
|
4287
4287
|
webDir: resolveWebDir(),
|
|
4288
4288
|
telegramBotTokens: process.env.TELEGRAM_BOT_TOKENS ? process.env.TELEGRAM_BOT_TOKENS.split(",").map((t) => t.trim() || void 0) : (saved.telegramBotTokens ?? []).map((t) => t || void 0),
|
|
4289
4289
|
detectedBackends: saved.detectedBackends ?? [],
|
|
4290
|
-
defaultBackend: saved.defaultBackend ?? "claude"
|
|
4290
|
+
defaultBackend: saved.defaultBackend ?? "claude",
|
|
4291
|
+
sandboxMode: saved.sandboxMode ?? "full"
|
|
4291
4292
|
};
|
|
4292
4293
|
}
|
|
4293
4294
|
var config = buildConfig();
|
|
@@ -4331,7 +4332,7 @@ var wsChannel = {
|
|
|
4331
4332
|
async init(commandHandler) {
|
|
4332
4333
|
onCommand = commandHandler;
|
|
4333
4334
|
return new Promise((resolve2) => {
|
|
4334
|
-
const
|
|
4335
|
+
const requestHandler = async (req, res) => {
|
|
4335
4336
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
4336
4337
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
4337
4338
|
res.setHeader("Access-Control-Allow-Headers", "Content-Type");
|
|
@@ -4423,10 +4424,11 @@ var wsChannel = {
|
|
|
4423
4424
|
return;
|
|
4424
4425
|
}
|
|
4425
4426
|
await serveStatic(req, res);
|
|
4426
|
-
}
|
|
4427
|
+
};
|
|
4427
4428
|
const maxRetries = 10;
|
|
4428
4429
|
let port = config.wsPort;
|
|
4429
4430
|
const tryListen = () => {
|
|
4431
|
+
const httpServer = createServer(requestHandler);
|
|
4430
4432
|
httpServer.listen(port, () => {
|
|
4431
4433
|
config.wsPort = port;
|
|
4432
4434
|
wss = new WebSocketServer({ server: httpServer });
|
|
@@ -4455,7 +4457,6 @@ var wsChannel = {
|
|
|
4455
4457
|
const oldPort = port;
|
|
4456
4458
|
port++;
|
|
4457
4459
|
console.log(`[WS] Port ${oldPort} in use, trying ${port}...`);
|
|
4458
|
-
httpServer.close();
|
|
4459
4460
|
tryListen();
|
|
4460
4461
|
} else {
|
|
4461
4462
|
console.error(`[WS] Failed to start server:`, err.message);
|
|
@@ -4588,7 +4589,10 @@ var backends = [
|
|
|
4588
4589
|
id: "codex",
|
|
4589
4590
|
name: "Codex CLI",
|
|
4590
4591
|
command: "codex",
|
|
4591
|
-
buildArgs(prompt) {
|
|
4592
|
+
buildArgs(prompt, opts) {
|
|
4593
|
+
if (opts.fullAccess) {
|
|
4594
|
+
return ["exec", prompt, "--dangerously-bypass-approvals-and-sandbox"];
|
|
4595
|
+
}
|
|
4592
4596
|
return ["exec", prompt, "--full-auto"];
|
|
4593
4597
|
}
|
|
4594
4598
|
},
|
|
@@ -4669,7 +4673,7 @@ var AgentSession = class {
|
|
|
4669
4673
|
type: "TASK_FAILED",
|
|
4670
4674
|
agentId: this.agentId,
|
|
4671
4675
|
taskId,
|
|
4672
|
-
error: "Agent is
|
|
4676
|
+
error: "Agent is working hard, please wait..."
|
|
4673
4677
|
});
|
|
4674
4678
|
return;
|
|
4675
4679
|
}
|
|
@@ -4695,7 +4699,8 @@ var AgentSession = class {
|
|
|
4695
4699
|
` : "";
|
|
4696
4700
|
const delegationHint = "To delegate a task to another agent, output on its own line: @AgentName: <task description>\n\n";
|
|
4697
4701
|
const identityPrompt = `Your name is ${this.name}, your role is ${this.role}. ${personalityClause}${delegationHint}${prompt}`;
|
|
4698
|
-
const
|
|
4702
|
+
const fullAccess = config.sandboxMode === "full";
|
|
4703
|
+
const args = this.backend.buildArgs(identityPrompt, { continue: this.hasHistory, fullAccess });
|
|
4699
4704
|
this.process = spawn(this.backend.command, args, {
|
|
4700
4705
|
cwd,
|
|
4701
4706
|
env: cleanEnv,
|
|
@@ -5069,7 +5074,7 @@ async function runSetup() {
|
|
|
5069
5074
|
const detectedNames = detected.map((id) => getBackend(id)?.name ?? id).join(", ");
|
|
5070
5075
|
console.log(`[Setup] Found: ${detectedNames || "none"}`);
|
|
5071
5076
|
if (!process.stdin.isTTY) {
|
|
5072
|
-
saveConfig({ detectedBackends: detected, defaultBackend: detected[0] ?? "claude" });
|
|
5077
|
+
saveConfig({ detectedBackends: detected, defaultBackend: detected[0] ?? "claude", sandboxMode: "full" });
|
|
5073
5078
|
console.log("\u2713 Default config saved to ~/.bit-office/config.json");
|
|
5074
5079
|
console.log(" Run with --setup in a terminal to configure.\n");
|
|
5075
5080
|
return;
|
|
@@ -5099,15 +5104,22 @@ async function runSetup() {
|
|
|
5099
5104
|
defaultBackend = detected[idx];
|
|
5100
5105
|
}
|
|
5101
5106
|
}
|
|
5107
|
+
console.log("\n\u2500\u2500 Agent Permissions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
5108
|
+
console.log("1 = Full access (agents can access entire machine)");
|
|
5109
|
+
console.log("2 = Sandbox (agents restricted to working directory)");
|
|
5110
|
+
const sandboxPick = await ask(rl, "Permission mode (1/2, default=1): ");
|
|
5111
|
+
const sandboxMode = sandboxPick === "2" ? "safe" : "full";
|
|
5102
5112
|
rl.close();
|
|
5103
5113
|
saveConfig({
|
|
5104
5114
|
ablyApiKey: ablyApiKey || void 0,
|
|
5105
5115
|
detectedBackends: detected,
|
|
5106
|
-
defaultBackend
|
|
5116
|
+
defaultBackend,
|
|
5117
|
+
sandboxMode
|
|
5107
5118
|
});
|
|
5108
5119
|
console.log("\n\u2713 Config saved to ~/.bit-office/config.json");
|
|
5109
5120
|
if (ablyApiKey) console.log(" \u2022 Ably: enabled");
|
|
5110
5121
|
console.log(` \u2022 Default AI: ${getBackend(defaultBackend)?.name ?? defaultBackend}`);
|
|
5122
|
+
console.log(` \u2022 Permissions: ${sandboxMode === "full" ? "Full access" : "Sandbox"}`);
|
|
5111
5123
|
console.log(" \u2022 Run with --setup to reconfigure\n");
|
|
5112
5124
|
}
|
|
5113
5125
|
|
|
@@ -5270,6 +5282,7 @@ async function main() {
|
|
|
5270
5282
|
}
|
|
5271
5283
|
const backendNames = config.detectedBackends.map((id) => getBackend(id)?.name ?? id).join(", ");
|
|
5272
5284
|
console.log(`[Gateway] AI backends: ${backendNames || "none detected"} (default: ${getBackend(config.defaultBackend)?.name ?? config.defaultBackend})`);
|
|
5285
|
+
console.log(`[Gateway] Permissions: ${config.sandboxMode === "full" ? "Full access" : "Sandbox"}`);
|
|
5273
5286
|
console.log(`[Gateway] Starting for machine: ${config.machineId}`);
|
|
5274
5287
|
showPairCode();
|
|
5275
5288
|
await initTransports(handleCommand);
|