open-agents-ai 0.187.577 → 0.187.578
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 +68 -4
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -548908,7 +548908,7 @@ function buildCommandDef(name10, signatures) {
|
|
|
548908
548908
|
const argsHint = inferArgsHint(signatures[0]?.signature ?? `/${name10}`);
|
|
548909
548909
|
const surfaces = {
|
|
548910
548910
|
tui: true,
|
|
548911
|
-
rest: status === "implemented" && !["quit", "exit"].includes(name10),
|
|
548911
|
+
rest: status === "implemented" && !["quit", "exit"].includes(name10) && !safety.destructive && !safety.secretBearing && !REST_BLOCKED.has(name10),
|
|
548912
548912
|
gateway: status === "implemented" && !safety.destructive && !safety.secretBearing,
|
|
548913
548913
|
agentTool: status === "implemented" && !safety.userOnly && !safety.destructive && !safety.secretBearing && !safety.profileGated
|
|
548914
548914
|
};
|
|
@@ -548942,7 +548942,7 @@ function inferArgsHint(signature) {
|
|
|
548942
548942
|
function normalizeCommandName(name10) {
|
|
548943
548943
|
return name10.replace(/^\//, "").trim().toLowerCase();
|
|
548944
548944
|
}
|
|
548945
|
-
var COMMAND_SIGNATURES, PLANNED_SIGNATURES, CATEGORY_OVERRIDES, ALIASES, USER_ONLY, DESTRUCTIVE, NETWORKED, SECRET_BEARING, PROFILE_GATED, CANONICAL_BY_ALIAS, DYNAMIC_COMMANDS, SLASH_COMMANDS;
|
|
548945
|
+
var COMMAND_SIGNATURES, PLANNED_SIGNATURES, CATEGORY_OVERRIDES, ALIASES, USER_ONLY, DESTRUCTIVE, NETWORKED, SECRET_BEARING, PROFILE_GATED, REST_BLOCKED, CANONICAL_BY_ALIAS, DYNAMIC_COMMANDS, SLASH_COMMANDS;
|
|
548946
548946
|
var init_command_registry = __esm({
|
|
548947
548947
|
"packages/cli/src/tui/command-registry.ts"() {
|
|
548948
548948
|
"use strict";
|
|
@@ -549371,6 +549371,16 @@ var init_command_registry = __esm({
|
|
|
549371
549371
|
"deny",
|
|
549372
549372
|
"sethome"
|
|
549373
549373
|
]);
|
|
549374
|
+
REST_BLOCKED = /* @__PURE__ */ new Set([
|
|
549375
|
+
"pause",
|
|
549376
|
+
"resume",
|
|
549377
|
+
"retry",
|
|
549378
|
+
"undo",
|
|
549379
|
+
"rollback",
|
|
549380
|
+
"background",
|
|
549381
|
+
"bg",
|
|
549382
|
+
"paste"
|
|
549383
|
+
]);
|
|
549374
549384
|
CANONICAL_BY_ALIAS = /* @__PURE__ */ new Map();
|
|
549375
549385
|
for (const [canonical, aliases] of Object.entries(ALIASES)) {
|
|
549376
549386
|
for (const alias of aliases) CANONICAL_BY_ALIAS.set(alias, canonical);
|
|
@@ -596435,7 +596445,8 @@ async function handleCommandPassthrough(ctx3) {
|
|
|
596435
596445
|
}));
|
|
596436
596446
|
return true;
|
|
596437
596447
|
}
|
|
596438
|
-
const
|
|
596448
|
+
const normalizedInput = input.trim().startsWith("/") ? input.trim() : `/${input.trim()}`;
|
|
596449
|
+
const [commandName = "", ...commandArgs] = normalizedInput.replace(/^\//, "").split(/\s+/);
|
|
596439
596450
|
const registryCommand = findCommand(commandName);
|
|
596440
596451
|
if (registryCommand && !registryCommand.surfaces.rest) {
|
|
596441
596452
|
sendProblem(res, problemDetails({
|
|
@@ -596448,9 +596459,14 @@ async function handleCommandPassthrough(ctx3) {
|
|
|
596448
596459
|
}));
|
|
596449
596460
|
return true;
|
|
596450
596461
|
}
|
|
596462
|
+
if (commandName === "queue" || commandName === "q") {
|
|
596463
|
+
const prompt = commandArgs.join(" ").trim();
|
|
596464
|
+
const queued = await handleRestQueueCommand(ctx3, body, commandName, prompt);
|
|
596465
|
+
if (queued) return true;
|
|
596466
|
+
}
|
|
596451
596467
|
try {
|
|
596452
596468
|
const { runCommand: runCommand3 } = await Promise.resolve().then(() => (init_command_passthrough(), command_passthrough_exports));
|
|
596453
|
-
const result = await runCommand3(
|
|
596469
|
+
const result = await runCommand3(normalizedInput);
|
|
596454
596470
|
sendJson(res, 200, result);
|
|
596455
596471
|
} catch (err) {
|
|
596456
596472
|
sendProblem(res, problemDetails({
|
|
@@ -596463,6 +596479,47 @@ async function handleCommandPassthrough(ctx3) {
|
|
|
596463
596479
|
}
|
|
596464
596480
|
return true;
|
|
596465
596481
|
}
|
|
596482
|
+
async function handleRestQueueCommand(ctx3, body, commandName, prompt) {
|
|
596483
|
+
const { res, requestId } = ctx3;
|
|
596484
|
+
if (!prompt) return false;
|
|
596485
|
+
const sessionId = typeof body?.sessionId === "string" ? body.sessionId : typeof body?.session_id === "string" ? body.session_id : "";
|
|
596486
|
+
if (!sessionId) {
|
|
596487
|
+
sendProblem(res, problemDetails({
|
|
596488
|
+
type: P.invalidRequest,
|
|
596489
|
+
status: 400,
|
|
596490
|
+
title: "sessionId required",
|
|
596491
|
+
detail: "REST /queue requires a chat sessionId so the prompt can be delivered at a turn boundary.",
|
|
596492
|
+
instance: requestId
|
|
596493
|
+
}));
|
|
596494
|
+
return true;
|
|
596495
|
+
}
|
|
596496
|
+
const { lookupSession: lookupSession2, addCheckinMessage: addCheckinMessage2, appendCheckin: appendCheckin2 } = await Promise.resolve().then(() => (init_chat_session(), chat_session_exports));
|
|
596497
|
+
const session = lookupSession2(sessionId);
|
|
596498
|
+
if (!session) {
|
|
596499
|
+
sendProblem(res, problemDetails({
|
|
596500
|
+
type: P.notFound,
|
|
596501
|
+
status: 404,
|
|
596502
|
+
title: "Session not found",
|
|
596503
|
+
detail: `No chat session found for id ${sessionId}.`,
|
|
596504
|
+
instance: requestId
|
|
596505
|
+
}));
|
|
596506
|
+
return true;
|
|
596507
|
+
}
|
|
596508
|
+
addCheckinMessage2(session, prompt);
|
|
596509
|
+
appendCheckin2(sessionId, `[QUEUED NEXT-TURN PROMPT]
|
|
596510
|
+
${prompt}`);
|
|
596511
|
+
sendJson(res, 200, {
|
|
596512
|
+
ok: true,
|
|
596513
|
+
command: commandName,
|
|
596514
|
+
args: prompt,
|
|
596515
|
+
kind: "handled",
|
|
596516
|
+
output: `Queued prompt for session ${sessionId}.`,
|
|
596517
|
+
ansi: "",
|
|
596518
|
+
durationMs: 0,
|
|
596519
|
+
sessionId
|
|
596520
|
+
});
|
|
596521
|
+
return true;
|
|
596522
|
+
}
|
|
596466
596523
|
async function handleRevokeKey(ctx3, prefix) {
|
|
596467
596524
|
const { req: req2, res, requestId } = ctx3;
|
|
596468
596525
|
const reqAuth = req2;
|
|
@@ -610585,6 +610642,13 @@ async function handlePostCommand(res, cmd) {
|
|
|
610585
610642
|
});
|
|
610586
610643
|
return;
|
|
610587
610644
|
}
|
|
610645
|
+
if (cmdBase === "queue" || cmdBase === "q") {
|
|
610646
|
+
jsonResponse(res, 400, {
|
|
610647
|
+
error: "sessionId required",
|
|
610648
|
+
message: 'Use POST /v1/command with { input: "/queue <prompt>", sessionId } so the prompt can be delivered to a chat session.'
|
|
610649
|
+
});
|
|
610650
|
+
return;
|
|
610651
|
+
}
|
|
610588
610652
|
try {
|
|
610589
610653
|
const { runCommand: runCommand3 } = await Promise.resolve().then(() => (init_command_passthrough(), command_passthrough_exports));
|
|
610590
610654
|
const result = await runCommand3(`/${cmd}`);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-agents-ai",
|
|
3
|
-
"version": "0.187.
|
|
3
|
+
"version": "0.187.578",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "open-agents-ai",
|
|
9
|
-
"version": "0.187.
|
|
9
|
+
"version": "0.187.578",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "CC-BY-NC-4.0",
|
|
12
12
|
"dependencies": {
|
package/package.json
CHANGED