@preplabsai/rovara-code 0.5.8 → 0.5.9
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/bin/agentx-cli.mjs +48 -17
- package/package.json +1 -1
package/bin/agentx-cli.mjs
CHANGED
|
@@ -24514,7 +24514,7 @@ function modelSourceSchema(options = {}) {
|
|
|
24514
24514
|
];
|
|
24515
24515
|
return external_exports.discriminatedUnion("kind", options.customModelEndpoint === false ? shapes.slice(0, 4) : shapes);
|
|
24516
24516
|
}
|
|
24517
|
-
var ModelSourceKindSchema, MAX_MODELS_PER_SOURCE, MAX_CUSTOM_SOURCES_PER_ORG, BEDROCK_ROLE_ARN_PATTERN, REGION_PATTERN, SOURCE_ID_PATTERN, BEDROCK_EXTERNAL_ID_PATTERN, EXTERNAL_ID_PATTERN, CATALOG_PROVIDER, MODEL_ENDPOINT_SECRET_PREFIX, MODEL_ENDPOINT_SECRET_REF, MODEL_ENDPOINT_SECRET_REF_MAX, QUALIFICATION_DIGEST, LabelSchema, ModelSourceInputSchema, ModelSourceSchema, OrgModelSourcesSchema;
|
|
24517
|
+
var ROVARA_AI_PAUSED_MESSAGE, ModelSourceKindSchema, MAX_MODELS_PER_SOURCE, MAX_CUSTOM_SOURCES_PER_ORG, BEDROCK_ROLE_ARN_PATTERN, REGION_PATTERN, SOURCE_ID_PATTERN, BEDROCK_EXTERNAL_ID_PATTERN, EXTERNAL_ID_PATTERN, CATALOG_PROVIDER, MODEL_ENDPOINT_SECRET_PREFIX, MODEL_ENDPOINT_SECRET_REF, MODEL_ENDPOINT_SECRET_REF_MAX, QUALIFICATION_DIGEST, LabelSchema, ModelSourceInputSchema, ModelSourceSchema, OrgModelSourcesSchema;
|
|
24518
24518
|
var init_model_sources = __esm({
|
|
24519
24519
|
"packages/contracts/dist/model-sources.js"() {
|
|
24520
24520
|
"use strict";
|
|
@@ -24523,6 +24523,7 @@ var init_model_sources = __esm({
|
|
|
24523
24523
|
init_chatgpt();
|
|
24524
24524
|
init_models();
|
|
24525
24525
|
init_models_node();
|
|
24526
|
+
ROVARA_AI_PAUSED_MESSAGE = "Rovara's AI is paused on this install. Your work is safe; try again later or use your own AI source.";
|
|
24526
24527
|
ModelSourceKindSchema = external_exports.enum(["rovara", "personal-chatgpt", "anthropic", "openai", "openrouter", "bedrock", "endpoint"]);
|
|
24527
24528
|
MAX_MODELS_PER_SOURCE = 20;
|
|
24528
24529
|
MAX_CUSTOM_SOURCES_PER_ORG = 10;
|
|
@@ -25935,6 +25936,8 @@ var init_routes = __esm({
|
|
|
25935
25936
|
{ method: "GET", path: "/v1/app/sessions/{sessionId}", requires: "tasks:read" },
|
|
25936
25937
|
// The task's log of questions, answers and decisions (B5): the same readers as the session; one more row, nothing existing changed.
|
|
25937
25938
|
{ method: "GET", path: "/v1/app/sessions/{sessionId}/log", requires: "tasks:read" },
|
|
25939
|
+
// The task's agent activity (#1548, #1589): the same readers as the session and its log.
|
|
25940
|
+
{ method: "GET", path: "/v1/app/sessions/{sessionId}/activity", requires: "tasks:read" },
|
|
25938
25941
|
{ method: "POST", path: "/v1/app/sessions/{sessionId}/follow", requires: "tasks:read" },
|
|
25939
25942
|
{ method: "DELETE", path: "/v1/app/sessions/{sessionId}/follow", requires: "tasks:read" },
|
|
25940
25943
|
{ method: "POST", path: "/v1/app/sessions/{sessionId}/unfollow", requires: "tasks:read" },
|
|
@@ -71351,11 +71354,12 @@ var init_slack_answers = __esm({
|
|
|
71351
71354
|
});
|
|
71352
71355
|
|
|
71353
71356
|
// packages/contracts/dist/slack-model-access.js
|
|
71354
|
-
var ModelName, SlackModelAccessResultSchema;
|
|
71357
|
+
var ModelName, SlackModelAccessResultSchema, SLACK_MODEL_WORDS;
|
|
71355
71358
|
var init_slack_model_access = __esm({
|
|
71356
71359
|
"packages/contracts/dist/slack-model-access.js"() {
|
|
71357
71360
|
"use strict";
|
|
71358
71361
|
init_zod();
|
|
71362
|
+
init_model_sources();
|
|
71359
71363
|
ModelName = external_exports.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u);
|
|
71360
71364
|
SlackModelAccessResultSchema = external_exports.discriminatedUnion("status", [
|
|
71361
71365
|
external_exports.object({ status: external_exports.literal("install") }).strict(),
|
|
@@ -71368,6 +71372,17 @@ var init_slack_model_access = __esm({
|
|
|
71368
71372
|
}).strict(),
|
|
71369
71373
|
external_exports.object({ status: external_exports.literal("unavailable") }).strict()
|
|
71370
71374
|
]);
|
|
71375
|
+
SLACK_MODEL_WORDS = {
|
|
71376
|
+
installPaused: ROVARA_AI_PAUSED_MESSAGE,
|
|
71377
|
+
/** No gateway here, or a workspace that is not a company's. */
|
|
71378
|
+
notSetUp: "Rovara's AI isn't set up for this workspace yet. Ask a company admin to check the setup in Rovara.",
|
|
71379
|
+
/** The company has no connected AI source (or the one it has was refused). */
|
|
71380
|
+
noProvider: "Your company has no AI connected yet, so I can't answer here. A company admin can connect one in Rovara.",
|
|
71381
|
+
/** The company's monthly room for this is used up. */
|
|
71382
|
+
paused: "Your company's AI limit for this month is used up, so I can't answer here until it is raised or next month starts.",
|
|
71383
|
+
/** Anything else (a gateway fault, a timeout). */
|
|
71384
|
+
unavailable: "I couldn't reach your company's AI just now. Please try again in a minute."
|
|
71385
|
+
};
|
|
71371
71386
|
}
|
|
71372
71387
|
});
|
|
71373
71388
|
|
|
@@ -204980,16 +204995,21 @@ async function assertGatewayRunPrices(origin2, transport2 = fetch) {
|
|
|
204980
204995
|
}
|
|
204981
204996
|
async function waitForGatewayRunPrices(origin2, options = {}) {
|
|
204982
204997
|
const transport2 = options.transport ?? fetch;
|
|
204983
|
-
const timeoutMs = options.timeoutMs ??
|
|
204998
|
+
const timeoutMs = options.timeoutMs ?? GATEWAY_READY_TIMEOUT_MS;
|
|
204984
204999
|
const pollMs = options.pollMs ?? 5e3;
|
|
205000
|
+
const streak = Math.max(1, options.streak ?? GATEWAY_READY_STREAK);
|
|
204985
205001
|
const now = options.now ?? Date.now;
|
|
204986
205002
|
const sleep4 = options.sleep ?? ((ms) => new Promise((resolve17) => setTimeout(resolve17, ms)));
|
|
204987
205003
|
const deadline = now() + timeoutMs;
|
|
205004
|
+
let good = 0;
|
|
204988
205005
|
for (; ; ) {
|
|
204989
205006
|
try {
|
|
204990
205007
|
await assertGatewayRunPrices(origin2, transport2);
|
|
204991
|
-
|
|
205008
|
+
good += 1;
|
|
205009
|
+
if (good >= streak) return;
|
|
205010
|
+
continue;
|
|
204992
205011
|
} catch (error64) {
|
|
205012
|
+
good = 0;
|
|
204993
205013
|
if (now() >= deadline) throw error64;
|
|
204994
205014
|
await sleep4(Math.min(pollMs, Math.max(0, deadline - now())));
|
|
204995
205015
|
}
|
|
@@ -205020,11 +205040,13 @@ async function fetchControlPlaneTaskKeyIds(controlPlaneUrl, transport2 = fetch)
|
|
|
205020
205040
|
}
|
|
205021
205041
|
return unique5.join(",");
|
|
205022
205042
|
}
|
|
205023
|
-
var TASK_KID;
|
|
205043
|
+
var GATEWAY_READY_STREAK, GATEWAY_READY_TIMEOUT_MS, TASK_KID;
|
|
205024
205044
|
var init_gateway_price_preflight = __esm({
|
|
205025
205045
|
"packages/cli/src/deploy/gateway-price-preflight.ts"() {
|
|
205026
205046
|
"use strict";
|
|
205027
205047
|
init_dist2();
|
|
205048
|
+
GATEWAY_READY_STREAK = 3;
|
|
205049
|
+
GATEWAY_READY_TIMEOUT_MS = 42e4;
|
|
205028
205050
|
TASK_KID = /^[A-Za-z0-9_-]{16}$/u;
|
|
205029
205051
|
}
|
|
205030
205052
|
});
|
|
@@ -367611,7 +367633,7 @@ init_dist2();
|
|
|
367611
367633
|
import { realpathSync } from "node:fs";
|
|
367612
367634
|
|
|
367613
367635
|
// packages/cli/src/version.ts
|
|
367614
|
-
var RELEASE_VERSION = true ? "0.5.
|
|
367636
|
+
var RELEASE_VERSION = true ? "0.5.9" : void 0;
|
|
367615
367637
|
var CLI_VERSION = RELEASE_VERSION ?? "0.1.0";
|
|
367616
367638
|
function isPrereleaseVersion(version3) {
|
|
367617
367639
|
return /^\d+\.\d+\.\d+-/.test(version3);
|
|
@@ -376977,6 +376999,24 @@ init_dist2();
|
|
|
376977
376999
|
var REPLY_WAIT_MS = 10 * 6e4;
|
|
376978
377000
|
var POLL_MS3 = 15e3;
|
|
376979
377001
|
var EARLY_MS2 = 5e3;
|
|
377002
|
+
var REFUSAL_WORDS = new Set(Object.values(SLACK_MODEL_WORDS));
|
|
377003
|
+
var isRefusal = (entry) => typeof entry.responseText === "string" && REFUSAL_WORDS.has(entry.responseText.trim());
|
|
377004
|
+
function settledReply(mine, input2) {
|
|
377005
|
+
const answered = mine.find((entry) => entry.disposition === "answered" && !isRefusal(entry));
|
|
377006
|
+
if (answered !== void 0) {
|
|
377007
|
+
const seconds2 = Math.round(answered.durationMs / 1e3);
|
|
377008
|
+
input2.write(`AgentX replied in #${input2.channelName} in ${seconds2} seconds.`);
|
|
377009
|
+
return { eventId: answered.eventId, seconds: seconds2 };
|
|
377010
|
+
}
|
|
377011
|
+
const other = mine[0];
|
|
377012
|
+
if (other === void 0) return void 0;
|
|
377013
|
+
for (const entry of mine) input2.reported?.add(entry.eventId);
|
|
377014
|
+
const refused5 = mine.find((entry) => entry.disposition === "answered");
|
|
377015
|
+
if (refused5 !== void 0) {
|
|
377016
|
+
throw agentXError("RUNTIME_UNAVAILABLE", `AgentX answered in #${input2.channelName}, but only with its fixed refusal "${(refused5.responseText ?? "").trim()}": it made no model call. See agentx --env ${input2.env} admin turns export --since 15m and the Slack service's log (model_access), fix it, then run ${input2.rerun} again`);
|
|
377017
|
+
}
|
|
377018
|
+
throw agentXError("RUNTIME_UNAVAILABLE", `AgentX replied in #${input2.channelName}, but the turn ended as ${other.disposition}${other.error === void 0 ? "" : ` (${other.error.name})`}; see agentx --env ${input2.env} admin turns export --since 15m, fix it, then run ${input2.rerun} again`);
|
|
377019
|
+
}
|
|
376980
377020
|
async function waitForThreadedReply(input2) {
|
|
376981
377021
|
const timeout = input2.timeoutMs ?? REPLY_WAIT_MS;
|
|
376982
377022
|
const count8 = Math.round(timeout / 6e4);
|
|
@@ -376991,17 +377031,8 @@ async function waitForThreadedReply(input2) {
|
|
|
376991
377031
|
turns.push(JSON.parse(line21));
|
|
376992
377032
|
} }, input2.fetch);
|
|
376993
377033
|
const mine = turns.filter((entry) => entry.subject.startsWith(prefix2) && Date.parse(entry.receivedAt) >= started - EARLY_MS2 && input2.reported?.has(entry.eventId) !== true);
|
|
376994
|
-
const
|
|
376995
|
-
if (
|
|
376996
|
-
const seconds2 = Math.round(answered.durationMs / 1e3);
|
|
376997
|
-
input2.write(`AgentX replied in #${input2.channelName} in ${seconds2} seconds.`);
|
|
376998
|
-
return { eventId: answered.eventId, seconds: seconds2 };
|
|
376999
|
-
}
|
|
377000
|
-
const other = mine[0];
|
|
377001
|
-
if (other !== void 0) {
|
|
377002
|
-
for (const entry of mine) input2.reported?.add(entry.eventId);
|
|
377003
|
-
throw agentXError("RUNTIME_UNAVAILABLE", `AgentX replied in #${input2.channelName}, but the turn ended as ${other.disposition}${other.error === void 0 ? "" : ` (${other.error.name})`}; see agentx --env ${input2.env} admin turns export --since 15m, fix it, then run ${input2.rerun} again`);
|
|
377004
|
-
}
|
|
377034
|
+
const reply = settledReply(mine, input2);
|
|
377035
|
+
if (reply !== void 0) return reply;
|
|
377005
377036
|
if (input2.now() - started >= timeout) {
|
|
377006
377037
|
throw agentXError("RUNTIME_UNAVAILABLE", `no AgentX reply in #${input2.channelName} within ${minutes2}; check that the message mentioned the bot, that Slack shows the Request URL as Verified, and agentx --env ${input2.env} admin turns export --since 15m, then run ${input2.rerun} again`);
|
|
377007
377038
|
}
|