@flue/cli 0.0.11 → 0.0.13
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/flue.js +16 -9
- package/package.json +4 -2
- package/dist/dist-C2CPKdvn.mjs +0 -2406
package/dist/flue.js
CHANGED
|
@@ -91,7 +91,7 @@ function startEventStream(workdir) {
|
|
|
91
91
|
} };
|
|
92
92
|
}
|
|
93
93
|
async function _consumeEventStream(signal, workdir, sessionNames, textBuffers) {
|
|
94
|
-
const { transformEvent } = await import("
|
|
94
|
+
const { transformEvent } = await import("@flue/client");
|
|
95
95
|
const url = `${OPENCODE_URL}/event?directory=${encodeURIComponent(workdir)}`;
|
|
96
96
|
const res = await fetch(url, { signal });
|
|
97
97
|
if (!res.ok || !res.body) {
|
|
@@ -204,7 +204,7 @@ async function run() {
|
|
|
204
204
|
process.exit(1);
|
|
205
205
|
}
|
|
206
206
|
const workflowUrl = pathToFileURL(path.isAbsolute(workflowPath) ? workflowPath : path.resolve(workdir, workflowPath)).href;
|
|
207
|
-
const { Flue } = await import("
|
|
207
|
+
const { Flue } = await import("@flue/client");
|
|
208
208
|
if (!await isOpenCodeRunning()) {
|
|
209
209
|
startedOpenCode = startOpenCodeServer();
|
|
210
210
|
openCodeProcess = startedOpenCode;
|
|
@@ -279,22 +279,29 @@ async function preflight(workdir, modelOverride) {
|
|
|
279
279
|
* against new permission types being added.
|
|
280
280
|
*/
|
|
281
281
|
async function setPermissions(workdir) {
|
|
282
|
+
const permission = {
|
|
283
|
+
"*": "allow",
|
|
284
|
+
edit: "allow",
|
|
285
|
+
bash: "allow",
|
|
286
|
+
webfetch: "allow",
|
|
287
|
+
doom_loop: "allow",
|
|
288
|
+
external_directory: "allow"
|
|
289
|
+
};
|
|
282
290
|
const res = await fetch(`${OPENCODE_URL}/config?directory=${encodeURIComponent(workdir)}`, {
|
|
283
291
|
method: "PATCH",
|
|
284
292
|
headers: { "Content-Type": "application/json" },
|
|
285
|
-
body: JSON.stringify({ permission
|
|
286
|
-
edit: "allow",
|
|
287
|
-
bash: "allow",
|
|
288
|
-
webfetch: "allow",
|
|
289
|
-
doom_loop: "allow",
|
|
290
|
-
external_directory: "allow"
|
|
291
|
-
} })
|
|
293
|
+
body: JSON.stringify({ permission })
|
|
292
294
|
});
|
|
293
295
|
if (!res.ok) {
|
|
294
296
|
const body = await res.text().catch(() => "");
|
|
295
297
|
console.error(`[flue] Error: failed to set permissions (HTTP ${res.status}).\n Response: ${body}\n Headless mode requires all permissions to be pre-approved.\n The agent will hang on any permission prompt without this.`);
|
|
296
298
|
process.exit(1);
|
|
297
299
|
}
|
|
300
|
+
const verify = await fetch(`${OPENCODE_URL}/config?directory=${encodeURIComponent(workdir)}`);
|
|
301
|
+
if (verify.ok) {
|
|
302
|
+
const config = await verify.json();
|
|
303
|
+
console.log(`[flue] permissions set:`, JSON.stringify(config.permission));
|
|
304
|
+
}
|
|
298
305
|
}
|
|
299
306
|
async function isOpenCodeRunning() {
|
|
300
307
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flue/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"flue": "dist/flue.js"
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
"build": "tsdown && mv dist/flue.mjs dist/flue.js",
|
|
13
13
|
"check:types": "tsc --noEmit"
|
|
14
14
|
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@flue/client": "^0.0.6"
|
|
17
|
+
},
|
|
15
18
|
"devDependencies": {
|
|
16
|
-
"@flue/client": "workspace:*",
|
|
17
19
|
"tsdown": "^0.20.3"
|
|
18
20
|
}
|
|
19
21
|
}
|