opencode-agents 1.0.10 → 1.0.12
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 +17 -17
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/commands/add.ts +4 -5
package/dist/index.js
CHANGED
|
@@ -7534,7 +7534,7 @@ var require_buffer_list = __commonJS({
|
|
|
7534
7534
|
}
|
|
7535
7535
|
}, {
|
|
7536
7536
|
key: "join",
|
|
7537
|
-
value: function
|
|
7537
|
+
value: function join6(s) {
|
|
7538
7538
|
if (this.length === 0) return "";
|
|
7539
7539
|
var p = this.head;
|
|
7540
7540
|
var ret = "" + p.data;
|
|
@@ -18309,8 +18309,8 @@ var require_index_688c5d50 = __commonJS({
|
|
|
18309
18309
|
var pathReservations = () => {
|
|
18310
18310
|
const queues = /* @__PURE__ */ new Map();
|
|
18311
18311
|
const reservations = /* @__PURE__ */ new Map();
|
|
18312
|
-
const { join:
|
|
18313
|
-
const getDirs = (path2) =>
|
|
18312
|
+
const { join: join6 } = path__default["default"];
|
|
18313
|
+
const getDirs = (path2) => join6(path2).split(/[\\/]/).slice(0, -1).reduce((set, path3) => set.length ? set.concat(join6(set[set.length - 1], path3)) : [path3], []);
|
|
18314
18314
|
const running = /* @__PURE__ */ new Set();
|
|
18315
18315
|
const getQueues = (fn) => {
|
|
18316
18316
|
const res = reservations.get(fn);
|
|
@@ -24794,7 +24794,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
24794
24794
|
}
|
|
24795
24795
|
var base = path__default["default"].join(homeOrTmp, ".degit");
|
|
24796
24796
|
var validModes = /* @__PURE__ */ new Set(["tar", "git"]);
|
|
24797
|
-
function
|
|
24797
|
+
function degit2(src2, opts) {
|
|
24798
24798
|
return new Degit(src2, opts);
|
|
24799
24799
|
}
|
|
24800
24800
|
var Degit = class extends Events__default["default"] {
|
|
@@ -24821,7 +24821,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
24821
24821
|
{ force: true },
|
|
24822
24822
|
{ cache: action.cache, verbose: action.verbose }
|
|
24823
24823
|
);
|
|
24824
|
-
const d2 =
|
|
24824
|
+
const d2 = degit2(action.src, opts2);
|
|
24825
24825
|
d2.on("info", (event) => {
|
|
24826
24826
|
console.error(
|
|
24827
24827
|
source.cyan(`> ${event.message.replace("options.", "--")}`)
|
|
@@ -25144,7 +25144,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
25144
25144
|
}
|
|
25145
25145
|
exports2.base = base;
|
|
25146
25146
|
exports2.createCommonjsModule = createCommonjsModule;
|
|
25147
|
-
exports2.degit =
|
|
25147
|
+
exports2.degit = degit2;
|
|
25148
25148
|
exports2.source = source;
|
|
25149
25149
|
exports2.tryRequire = tryRequire;
|
|
25150
25150
|
}
|
|
@@ -25976,7 +25976,7 @@ async function fetchSource(source) {
|
|
|
25976
25976
|
if (source.startsWith(".") || source.startsWith("/") || /^[a-zA-Z]:\\/.test(source)) {
|
|
25977
25977
|
return source;
|
|
25978
25978
|
}
|
|
25979
|
-
const
|
|
25979
|
+
const degit2 = await Promise.resolve().then(() => __toESM(require_dist(), 1));
|
|
25980
25980
|
const tempDir = mkdtempSync(join3(tmpdir(), "npx-agents-"));
|
|
25981
25981
|
const parts = source.split("/");
|
|
25982
25982
|
let owner = parts[0];
|
|
@@ -25989,7 +25989,7 @@ async function fetchSource(source) {
|
|
|
25989
25989
|
}
|
|
25990
25990
|
try {
|
|
25991
25991
|
const target = ref ? `${owner}/${repo}#${ref}` : `${owner}/${repo}`;
|
|
25992
|
-
await
|
|
25992
|
+
await degit2.default(target).clone(tempDir);
|
|
25993
25993
|
return tempDir;
|
|
25994
25994
|
} catch (err) {
|
|
25995
25995
|
rmSync2(tempDir, { recursive: true, force: true });
|
|
@@ -26061,7 +26061,9 @@ function readlinkCheck(path, name) {
|
|
|
26061
26061
|
}
|
|
26062
26062
|
|
|
26063
26063
|
// src/commands/add.ts
|
|
26064
|
-
|
|
26064
|
+
var import_degit = __toESM(require_dist(), 1);
|
|
26065
|
+
import { basename as basename4, join as join4 } from "path";
|
|
26066
|
+
import { mkdtempSync as mkdtempSync2 } from "fs";
|
|
26065
26067
|
async function promptInstallLocation() {
|
|
26066
26068
|
const answers = await inquirer.prompt([
|
|
26067
26069
|
{
|
|
@@ -26094,9 +26096,7 @@ async function promptSelectAgents(agents) {
|
|
|
26094
26096
|
return answers.selected;
|
|
26095
26097
|
}
|
|
26096
26098
|
async function fetchSource2(source) {
|
|
26097
|
-
const
|
|
26098
|
-
const degit = await Promise.resolve().then(() => __toESM(require_dist(), 1));
|
|
26099
|
-
const tempDir = mkdtempSync2(join5(tmpdir2(), "agents-cli-"));
|
|
26099
|
+
const tempDir = mkdtempSync2(join4(tmpdir2(), "agents-cli-"));
|
|
26100
26100
|
const parts = source.split("/");
|
|
26101
26101
|
let owner = parts[0];
|
|
26102
26102
|
let repo = parts[1]?.replace(/#.+$/, "") || "";
|
|
@@ -26108,7 +26108,7 @@ async function fetchSource2(source) {
|
|
|
26108
26108
|
}
|
|
26109
26109
|
try {
|
|
26110
26110
|
const target = ref ? `${owner}/${repo}#${ref}` : `${owner}/${repo}`;
|
|
26111
|
-
await
|
|
26111
|
+
await (0, import_degit.default)(target).clone(tempDir);
|
|
26112
26112
|
return tempDir;
|
|
26113
26113
|
} catch (err) {
|
|
26114
26114
|
rmSync3(tempDir, { recursive: true, force: true });
|
|
@@ -26243,7 +26243,7 @@ async function removeCommand(name, options2) {
|
|
|
26243
26243
|
}
|
|
26244
26244
|
|
|
26245
26245
|
// src/commands/init.ts
|
|
26246
|
-
import { join as
|
|
26246
|
+
import { join as join5 } from "path";
|
|
26247
26247
|
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
|
|
26248
26248
|
import { fileURLToPath } from "url";
|
|
26249
26249
|
import { dirname as dirname2 } from "path";
|
|
@@ -26251,15 +26251,15 @@ var __dirname = dirname2(fileURLToPath(import.meta.url));
|
|
|
26251
26251
|
async function initCommand(name, _options) {
|
|
26252
26252
|
try {
|
|
26253
26253
|
const targetName = name || "my-agent";
|
|
26254
|
-
const targetDir = name ?
|
|
26255
|
-
const targetPath =
|
|
26254
|
+
const targetDir = name ? join5(process.cwd(), name) : process.cwd();
|
|
26255
|
+
const targetPath = join5(targetDir, `${targetName}.md`);
|
|
26256
26256
|
if (existsSync5(targetPath)) {
|
|
26257
26257
|
logger.error(`Agent file already exists at ${targetPath}`);
|
|
26258
26258
|
process.exit(1);
|
|
26259
26259
|
}
|
|
26260
26260
|
ensureDir(targetDir);
|
|
26261
26261
|
let template;
|
|
26262
|
-
const templatePath =
|
|
26262
|
+
const templatePath = join5(__dirname, "..", "..", "templates", "default-agent.md");
|
|
26263
26263
|
if (existsSync5(templatePath)) {
|
|
26264
26264
|
template = readFileSync4(templatePath, "utf-8");
|
|
26265
26265
|
} else {
|