@8gi-foundation/8gent-code 0.11.14 → 0.12.1
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/README.md +1 -1
- package/dist/cli.js +174 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
<p align="center">
|
|
22
22
|
<a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-E8610A?style=for-the-badge&labelColor=1A1612" alt="Apache 2.0 License" /></a>
|
|
23
|
-
<a href="https://8gent.dev"><img src="https://img.shields.io/badge/version-0.
|
|
23
|
+
<a href="https://8gent.dev"><img src="https://img.shields.io/badge/version-0.12.1-2D8A56?style=for-the-badge&labelColor=1A1612" alt="v0.12.1" /></a>
|
|
24
24
|
<a href="https://eight-vessel.fly.dev"><img src="https://img.shields.io/badge/daemon-Fly.io_Amsterdam-E8610A?style=for-the-badge&labelColor=1A1612" alt="Daemon" /></a>
|
|
25
25
|
</p>
|
|
26
26
|
|
package/dist/cli.js
CHANGED
|
@@ -183088,6 +183088,14 @@ var init_clients = __esm(() => {
|
|
|
183088
183088
|
});
|
|
183089
183089
|
|
|
183090
183090
|
// packages/hands/index.ts
|
|
183091
|
+
var exports_hands = {};
|
|
183092
|
+
__export(exports_hands, {
|
|
183093
|
+
openPrivacyPane: () => openPrivacyPane,
|
|
183094
|
+
getDriver: () => getDriver,
|
|
183095
|
+
disposeScreenshot: () => disposeScreenshot,
|
|
183096
|
+
checkPermissions: () => checkPermissions,
|
|
183097
|
+
_resetForTests: () => _resetForTests
|
|
183098
|
+
});
|
|
183091
183099
|
import { execFileSync, spawnSync as spawnSync2 } from "child_process";
|
|
183092
183100
|
import { existsSync as existsSync14, readFileSync as readFileSync13, unlinkSync as unlinkSync2 } from "fs";
|
|
183093
183101
|
import { tmpdir as tmpdir2 } from "os";
|
|
@@ -183452,6 +183460,93 @@ function getDriver() {
|
|
|
183452
183460
|
_driver = new MacosDriver;
|
|
183453
183461
|
return _driver;
|
|
183454
183462
|
}
|
|
183463
|
+
function _resetForTests() {
|
|
183464
|
+
_driver = null;
|
|
183465
|
+
_caps = null;
|
|
183466
|
+
}
|
|
183467
|
+
function checkPermissions() {
|
|
183468
|
+
let axGranted = false;
|
|
183469
|
+
let axDetail = "";
|
|
183470
|
+
try {
|
|
183471
|
+
const r = spawnSync2("/usr/bin/osascript", ["-e", 'tell application "System Events" to return name of first process whose frontmost is true'], { encoding: "utf-8", timeout: 3000 });
|
|
183472
|
+
if (r.status === 0 && r.stdout.trim().length > 0) {
|
|
183473
|
+
axGranted = true;
|
|
183474
|
+
axDetail = `frontmost: ${r.stdout.trim()}`;
|
|
183475
|
+
} else {
|
|
183476
|
+
axDetail = (r.stderr || "").trim().slice(0, 200) || `osascript exited ${r.status}`;
|
|
183477
|
+
}
|
|
183478
|
+
} catch (err) {
|
|
183479
|
+
axDetail = err instanceof Error ? err.message : "osascript spawn failed";
|
|
183480
|
+
}
|
|
183481
|
+
let srGranted = false;
|
|
183482
|
+
let srDetail = "";
|
|
183483
|
+
const probePath = join16(tmpdir2(), `8gent-hands-probe-${process.pid}.png`);
|
|
183484
|
+
try {
|
|
183485
|
+
const r = spawnSync2("/usr/sbin/screencapture", ["-x", "-r", probePath], {
|
|
183486
|
+
encoding: "utf-8",
|
|
183487
|
+
timeout: 5000
|
|
183488
|
+
});
|
|
183489
|
+
if (r.status === 0 && existsSync14(probePath)) {
|
|
183490
|
+
const buf = readFileSync13(probePath);
|
|
183491
|
+
if (buf.length > 50000) {
|
|
183492
|
+
srGranted = true;
|
|
183493
|
+
srDetail = `${(buf.length / 1024).toFixed(0)}KB capture`;
|
|
183494
|
+
} else {
|
|
183495
|
+
srDetail = `${buf.length}B placeholder \u2014 permission likely denied`;
|
|
183496
|
+
}
|
|
183497
|
+
} else {
|
|
183498
|
+
srDetail = (r.stderr || "").trim().slice(0, 200) || `screencapture exited ${r.status}`;
|
|
183499
|
+
}
|
|
183500
|
+
} catch (err) {
|
|
183501
|
+
srDetail = err instanceof Error ? err.message : "screencapture spawn failed";
|
|
183502
|
+
} finally {
|
|
183503
|
+
try {
|
|
183504
|
+
if (existsSync14(probePath))
|
|
183505
|
+
unlinkSync2(probePath);
|
|
183506
|
+
} catch {}
|
|
183507
|
+
}
|
|
183508
|
+
let terminalApp = process.env.TERM_PROGRAM || "";
|
|
183509
|
+
if (!terminalApp) {
|
|
183510
|
+
try {
|
|
183511
|
+
const ppid = process.ppid;
|
|
183512
|
+
const r = spawnSync2("/bin/ps", ["-o", "comm=", "-p", String(ppid)], {
|
|
183513
|
+
encoding: "utf-8",
|
|
183514
|
+
timeout: 1500
|
|
183515
|
+
});
|
|
183516
|
+
terminalApp = (r.stdout || "").trim();
|
|
183517
|
+
} catch {
|
|
183518
|
+
terminalApp = "your terminal";
|
|
183519
|
+
}
|
|
183520
|
+
}
|
|
183521
|
+
if (terminalApp === "iTerm.app")
|
|
183522
|
+
terminalApp = "iTerm";
|
|
183523
|
+
if (terminalApp === "Apple_Terminal")
|
|
183524
|
+
terminalApp = "Terminal";
|
|
183525
|
+
if (terminalApp === "vscode")
|
|
183526
|
+
terminalApp = "Visual Studio Code";
|
|
183527
|
+
return {
|
|
183528
|
+
accessibility: { granted: axGranted, detail: axDetail },
|
|
183529
|
+
screenRecording: { granted: srGranted, detail: srDetail },
|
|
183530
|
+
terminalApp: terminalApp || "your terminal",
|
|
183531
|
+
allGranted: axGranted && srGranted
|
|
183532
|
+
};
|
|
183533
|
+
}
|
|
183534
|
+
function openPrivacyPane(pane) {
|
|
183535
|
+
const key = pane === "accessibility" ? "Privacy_Accessibility" : "Privacy_ScreenCapture";
|
|
183536
|
+
const url = `x-apple.systempreferences:com.apple.preference.security?${key}`;
|
|
183537
|
+
try {
|
|
183538
|
+
const r = spawnSync2("/usr/bin/open", [url], { timeout: 3000 });
|
|
183539
|
+
return r.status === 0;
|
|
183540
|
+
} catch {
|
|
183541
|
+
return false;
|
|
183542
|
+
}
|
|
183543
|
+
}
|
|
183544
|
+
function disposeScreenshot(p) {
|
|
183545
|
+
try {
|
|
183546
|
+
if (existsSync14(p))
|
|
183547
|
+
unlinkSync2(p);
|
|
183548
|
+
} catch {}
|
|
183549
|
+
}
|
|
183455
183550
|
var _caps = null, KEY_ALIASES, MODIFIERS, MOD_TO_CLICLICK, _driver = null;
|
|
183456
183551
|
var init_hands = __esm(() => {
|
|
183457
183552
|
KEY_ALIASES = {
|
|
@@ -514934,7 +515029,7 @@ var exports_skill_creator = {};
|
|
|
514934
515029
|
__export(exports_skill_creator, {
|
|
514935
515030
|
getSessionCreationCount: () => getSessionCreationCount,
|
|
514936
515031
|
createAutoSkill: () => createAutoSkill,
|
|
514937
|
-
_resetForTests: () =>
|
|
515032
|
+
_resetForTests: () => _resetForTests2,
|
|
514938
515033
|
MAX_AUTO_SKILLS_PER_SESSION: () => MAX_AUTO_SKILLS_PER_SESSION
|
|
514939
515034
|
});
|
|
514940
515035
|
import * as fs44 from "fs";
|
|
@@ -515006,7 +515101,7 @@ function createAutoSkill(spec, context3) {
|
|
|
515006
515101
|
function getSessionCreationCount() {
|
|
515007
515102
|
return createdThisSession;
|
|
515008
515103
|
}
|
|
515009
|
-
function
|
|
515104
|
+
function _resetForTests2() {
|
|
515010
515105
|
createdThisSession = 0;
|
|
515011
515106
|
}
|
|
515012
515107
|
function sanitizeName(raw) {
|
|
@@ -526710,7 +526805,7 @@ If no issues, say "No issues found." No preamble.`;
|
|
|
526710
526805
|
import * as fs56 from "fs";
|
|
526711
526806
|
import * as path56 from "path";
|
|
526712
526807
|
var __dirname = "/Users/jamesspalding/8gent-code/bin";
|
|
526713
|
-
var VERSION5 = "0.
|
|
526808
|
+
var VERSION5 = "0.12.1";
|
|
526714
526809
|
var BANNER = `
|
|
526715
526810
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
526716
526811
|
\u2551 \u2551
|
|
@@ -526736,6 +526831,9 @@ COMMANDS:
|
|
|
526736
526831
|
tui [--name=<n>] [--resume=<n>] Launch TUI (--name to name session, --resume to restore)
|
|
526737
526832
|
run <prompt> One-shot agent run. Pairs with --output-format stream-json for Orchestra/cmux/etc.
|
|
526738
526833
|
doctor Check system health (Ollama, models, tools, config)
|
|
526834
|
+
update Update 8gent to the latest version on npm (uses --force to fix EEXIST)
|
|
526835
|
+
permissions Diagnose macOS Accessibility + Screen Recording grants for your terminal
|
|
526836
|
+
Use --open to auto-launch System Settings panes for missing grants
|
|
526739
526837
|
pet Launch Lil Eight dock companion only
|
|
526740
526838
|
chat <message> Send a message (non-interactive, pipe-friendly)
|
|
526741
526839
|
agent <sub> Multi-agent orchestration
|
|
@@ -527023,12 +527121,85 @@ async function main() {
|
|
|
527023
527121
|
case "doctor":
|
|
527024
527122
|
await doctorCommand();
|
|
527025
527123
|
break;
|
|
527124
|
+
case "update":
|
|
527125
|
+
case "upgrade":
|
|
527126
|
+
await updateCommand();
|
|
527127
|
+
break;
|
|
527128
|
+
case "permissions":
|
|
527129
|
+
case "perms":
|
|
527130
|
+
await permissionsCommand(restArgs);
|
|
527131
|
+
break;
|
|
527026
527132
|
default:
|
|
527027
527133
|
console.error(`Unknown command: ${command}`);
|
|
527028
527134
|
console.log(`Run '8 --help' for usage information.`);
|
|
527029
527135
|
process.exit(1);
|
|
527030
527136
|
}
|
|
527031
527137
|
}
|
|
527138
|
+
async function updateCommand() {
|
|
527139
|
+
const { spawn: spawn14 } = await import("child_process");
|
|
527140
|
+
console.log(`Current: v${VERSION5}`);
|
|
527141
|
+
console.log(`Updating @8gi-foundation/8gent-code to latest from npm...`);
|
|
527142
|
+
console.log(`(uses --force to overwrite stale bin symlinks)
|
|
527143
|
+
`);
|
|
527144
|
+
const proc = spawn14("npm", ["install", "-g", "@8gi-foundation/8gent-code@latest", "--force"], { stdio: "inherit" });
|
|
527145
|
+
await new Promise((resolve16) => {
|
|
527146
|
+
proc.on("exit", (code2) => {
|
|
527147
|
+
if (code2 === 0) {
|
|
527148
|
+
console.log(`
|
|
527149
|
+
Done. Restart your terminal session, then run \`8gent\` to use the new version.`);
|
|
527150
|
+
} else {
|
|
527151
|
+
console.error(`
|
|
527152
|
+
Update failed (exit ${code2}). Try manually:`);
|
|
527153
|
+
console.error(` npm install -g @8gi-foundation/8gent-code@latest --force`);
|
|
527154
|
+
}
|
|
527155
|
+
resolve16();
|
|
527156
|
+
});
|
|
527157
|
+
proc.on("error", (err) => {
|
|
527158
|
+
console.error(`
|
|
527159
|
+
Couldn't run npm: ${err.message}`);
|
|
527160
|
+
resolve16();
|
|
527161
|
+
});
|
|
527162
|
+
});
|
|
527163
|
+
}
|
|
527164
|
+
async function permissionsCommand(args) {
|
|
527165
|
+
const { checkPermissions: checkPermissions2, openPrivacyPane: openPrivacyPane2 } = await Promise.resolve().then(() => (init_hands(), exports_hands));
|
|
527166
|
+
const shouldOpen = args.includes("--open") || args.includes("-o");
|
|
527167
|
+
const report = checkPermissions2();
|
|
527168
|
+
const tick = (ok) => ok ? "\u2713" : "\u2717";
|
|
527169
|
+
console.log(`
|
|
527170
|
+
8gent permissions check (terminal: ${report.terminalApp})
|
|
527171
|
+
`);
|
|
527172
|
+
console.log(` ${tick(report.accessibility.granted)} Accessibility ${report.accessibility.detail}`);
|
|
527173
|
+
console.log(` ${tick(report.screenRecording.granted)} Screen Recording ${report.screenRecording.detail}`);
|
|
527174
|
+
console.log("");
|
|
527175
|
+
if (report.allGranted) {
|
|
527176
|
+
console.log(`All permissions granted. The hands tools should work.
|
|
527177
|
+
`);
|
|
527178
|
+
return;
|
|
527179
|
+
}
|
|
527180
|
+
console.log(`To fix, grant ${report.terminalApp} the missing permission(s) in:`);
|
|
527181
|
+
console.log(` System Settings \u2192 Privacy & Security \u2192 ...`);
|
|
527182
|
+
console.log("");
|
|
527183
|
+
if (!report.accessibility.granted) {
|
|
527184
|
+
console.log(` Accessibility (lets cliclick/osascript drive the cursor + keyboard)`);
|
|
527185
|
+
}
|
|
527186
|
+
if (!report.screenRecording.granted) {
|
|
527187
|
+
console.log(` Screen Recording (lets screencapture see the desktop)`);
|
|
527188
|
+
}
|
|
527189
|
+
console.log("");
|
|
527190
|
+
console.log(`Then **fully quit and relaunch ${report.terminalApp}** \u2014 macOS only re-checks permissions on relaunch.
|
|
527191
|
+
`);
|
|
527192
|
+
if (shouldOpen) {
|
|
527193
|
+
console.log(`Opening System Settings panes...`);
|
|
527194
|
+
if (!report.accessibility.granted)
|
|
527195
|
+
openPrivacyPane2("accessibility");
|
|
527196
|
+
if (!report.screenRecording.granted)
|
|
527197
|
+
openPrivacyPane2("screen-recording");
|
|
527198
|
+
} else {
|
|
527199
|
+
console.log(`Re-run with \`8gent permissions --open\` to auto-launch the right System Settings panes.
|
|
527200
|
+
`);
|
|
527201
|
+
}
|
|
527202
|
+
}
|
|
527032
527203
|
async function initCommand(args) {
|
|
527033
527204
|
console.log(BANNER);
|
|
527034
527205
|
console.log(`Initializing 8gent Code...
|
package/package.json
CHANGED