miii-agent 0.1.9 → 0.1.10
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/cli.js +12 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -300,8 +300,8 @@ var init_run_bash = __esm({
|
|
|
300
300
|
const out = [stdout, stderr].filter(Boolean).join("\n");
|
|
301
301
|
const is_error = exitCode !== 0;
|
|
302
302
|
const body = out || (is_error ? `(no output)` : "");
|
|
303
|
-
const content =
|
|
304
|
-
[exit ${exitCode}]
|
|
303
|
+
const content = `${body}
|
|
304
|
+
[exit ${exitCode}]`;
|
|
305
305
|
return {
|
|
306
306
|
content: content.slice(0, 32e3),
|
|
307
307
|
is_error
|
|
@@ -641,6 +641,7 @@ function matches(rule, toolName, subject) {
|
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
async function check(toolName, input, ctx) {
|
|
644
|
+
if (ALWAYS_ALLOW.has(toolName)) return "allow";
|
|
644
645
|
const subject = subjectFor(toolName, input);
|
|
645
646
|
const rules = loadRules();
|
|
646
647
|
if (rules.some((r) => matches(r, toolName, subject))) return "allow";
|
|
@@ -649,12 +650,13 @@ async function check(toolName, input, ctx) {
|
|
|
649
650
|
if (answer === "always") addRule(toolName, subject);
|
|
650
651
|
return "allow";
|
|
651
652
|
}
|
|
652
|
-
var RULES_DIR, RULES_PATH;
|
|
653
|
+
var RULES_DIR, RULES_PATH, ALWAYS_ALLOW;
|
|
653
654
|
var init_policy = __esm({
|
|
654
655
|
"src/permissions/policy.ts"() {
|
|
655
656
|
"use strict";
|
|
656
657
|
RULES_DIR = join4(homedir3(), ".miii");
|
|
657
658
|
RULES_PATH = join4(RULES_DIR, "permissions.json");
|
|
659
|
+
ALWAYS_ALLOW = /* @__PURE__ */ new Set(["read_file", "grep", "glob"]);
|
|
658
660
|
}
|
|
659
661
|
});
|
|
660
662
|
|
|
@@ -2572,7 +2574,7 @@ function App() {
|
|
|
2572
2574
|
})();
|
|
2573
2575
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 1, children: [
|
|
2574
2576
|
/* @__PURE__ */ jsx10(WelcomeBlock, { model: cfg.model, activeCtx, effort, cwd, error: agent.error }),
|
|
2575
|
-
updateAvailable && /* @__PURE__ */ jsx10(Box10, { marginLeft: 2, marginBottom: 1, children: /* @__PURE__ */ jsx10(Text10, { color: "yellow", children: `\u2191 update available: v${updateAvailable} \u2014 run:
|
|
2577
|
+
updateAvailable && /* @__PURE__ */ jsx10(Box10, { marginLeft: 2, marginBottom: 1, children: /* @__PURE__ */ jsx10(Text10, { color: "yellow", children: `\u2191 update available: v${updateAvailable} \u2014 run: miii --update` }) }),
|
|
2576
2578
|
state === "loading" && !agent.error && /* @__PURE__ */ jsx10(Box10, { marginLeft: 2, marginBottom: 1, children: /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: "connecting to ollama\u2026" }) }),
|
|
2577
2579
|
agent.error && state !== "ready" && /* @__PURE__ */ jsx10(
|
|
2578
2580
|
ChatView,
|
|
@@ -2634,7 +2636,12 @@ function App() {
|
|
|
2634
2636
|
|
|
2635
2637
|
// src/cli.tsx
|
|
2636
2638
|
var [, , cmd, ...rest] = process.argv;
|
|
2637
|
-
if (cmd === "
|
|
2639
|
+
if (cmd === "update" || cmd === "--update" || cmd === "-u") {
|
|
2640
|
+
const { spawnSync } = await import("child_process");
|
|
2641
|
+
console.log("Updating miii-agent\u2026");
|
|
2642
|
+
const r = spawnSync("npm", ["i", "-g", "miii-agent@latest"], { stdio: "inherit", shell: process.platform === "win32" });
|
|
2643
|
+
process.exit(r.status ?? 1);
|
|
2644
|
+
} else if (cmd === "doctor" || cmd === "eval") {
|
|
2638
2645
|
const { runEval: runEval2 } = await Promise.resolve().then(() => (init_run(), run_exports));
|
|
2639
2646
|
process.exit(await runEval2(rest));
|
|
2640
2647
|
} else {
|