@preplabsai/rovara-code 0.5.8 → 0.5.11

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.
Files changed (2) hide show
  1. package/bin/agentx-cli.mjs +99 -25
  2. package/package.json +2 -2
@@ -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 ?? 18e4;
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
- return;
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.8" : void 0;
367636
+ var RELEASE_VERSION = true ? "0.5.11" : 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);
@@ -372094,6 +372116,25 @@ async function ensureCognitoAdmin(input2) {
372094
372116
  return { created: false, temporaryPassword: false };
372095
372117
  }
372096
372118
 
372119
+ // packages/cli/src/init/ai-tool-prompt.ts
372120
+ init_dist2();
372121
+ var AI_TOOL_PROMPT_LABEL = "Paste this into Claude Code, Codex or Cursor";
372122
+ var ANOTHER_COMPUTER_DOCS_URL = "https://github.com/PrepLabsAI/Rovara-Code/blob/mainline/docs/cli-reference.md#use-an-existing-install-from-another-computer";
372123
+ function cliSource(invocation) {
372124
+ if (invocation.published && invocation.version !== void 0) return `npm package ${invocation.packageName ?? CLI_PACKAGE_NAME}@${invocation.version}`;
372125
+ return `built from source; on this computer: ${cliCommandLine(invocation, "").trimEnd()}`;
372126
+ }
372127
+ function aiToolPrompt(input2) {
372128
+ const { env: env3, region } = input2;
372129
+ return [
372130
+ `I run a self-hosted Rovara install named ${env3} in AWS region ${region}.`,
372131
+ "Read https://rovara.dev/llms.txt, then help me manage it with the rovara CLI",
372132
+ `(${cliSource(input2.invocation)}). Pass --env ${env3} to every command, and --region ${region} to the commands that take it.`,
372133
+ 'To connect this computer, follow "Use an existing install from another computer" in the CLI reference:',
372134
+ ANOTHER_COMPUTER_DOCS_URL
372135
+ ].join("\n");
372136
+ }
372137
+
372097
372138
  // packages/cli/src/init/prerequisites.ts
372098
372139
  var import_client_ec2 = __toESM(require_dist_cjs29(), 1);
372099
372140
  var import_client_service_quotas = __toESM(require_dist_cjs30(), 1);
@@ -373270,13 +373311,15 @@ function readyCard(input2) {
373270
373311
  { label: "Remove Rovara", command: cli("destroy") }
373271
373312
  ].map((command5) => ({ ...command5, group: READY_GROUPS.lookAfter }))
373272
373313
  ],
373314
+ // #1599: built from the install's name and region only, so it holds no secret.
373315
+ prompt: { label: AI_TOOL_PROMPT_LABEL, text: aiToolPrompt(input2) },
373273
373316
  ...input2.created.length === 0 ? {} : { details: [`What was created: ${input2.created.join(", ")}`] },
373274
373317
  ...project3?.channelId === void 0 || project3.channelName === void 0 || teamId === void 0 ? {} : { link: { url: slackChannelLink(teamId, project3.channelId), label: `Open #${project3.channelName} in Slack` } }
373275
373318
  };
373276
373319
  }
373277
373320
 
373278
373321
  // packages/cli/src/init/github-app.ts
373279
- var AGENTX_HOMEPAGE = "https://github.com/PrepLabsAI/Rovara";
373322
+ var AGENTX_HOMEPAGE = "https://github.com/PrepLabsAI/Rovara-Code";
373280
373323
  var GITHUB_WAIT_MS = 15 * 60 * 1e3;
373281
373324
  var POLL_MS = 5e3;
373282
373325
  var TOKEN_RENEW_MS = 5 * 60 * 1e3;
@@ -376977,6 +377020,24 @@ init_dist2();
376977
377020
  var REPLY_WAIT_MS = 10 * 6e4;
376978
377021
  var POLL_MS3 = 15e3;
376979
377022
  var EARLY_MS2 = 5e3;
377023
+ var REFUSAL_WORDS = new Set(Object.values(SLACK_MODEL_WORDS));
377024
+ var isRefusal = (entry) => typeof entry.responseText === "string" && REFUSAL_WORDS.has(entry.responseText.trim());
377025
+ function settledReply(mine, input2) {
377026
+ const answered = mine.find((entry) => entry.disposition === "answered" && !isRefusal(entry));
377027
+ if (answered !== void 0) {
377028
+ const seconds2 = Math.round(answered.durationMs / 1e3);
377029
+ input2.write(`AgentX replied in #${input2.channelName} in ${seconds2} seconds.`);
377030
+ return { eventId: answered.eventId, seconds: seconds2 };
377031
+ }
377032
+ const other = mine[0];
377033
+ if (other === void 0) return void 0;
377034
+ for (const entry of mine) input2.reported?.add(entry.eventId);
377035
+ const refused5 = mine.find((entry) => entry.disposition === "answered");
377036
+ if (refused5 !== void 0) {
377037
+ 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`);
377038
+ }
377039
+ 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`);
377040
+ }
376980
377041
  async function waitForThreadedReply(input2) {
376981
377042
  const timeout = input2.timeoutMs ?? REPLY_WAIT_MS;
376982
377043
  const count8 = Math.round(timeout / 6e4);
@@ -376991,17 +377052,8 @@ async function waitForThreadedReply(input2) {
376991
377052
  turns.push(JSON.parse(line21));
376992
377053
  } }, input2.fetch);
376993
377054
  const mine = turns.filter((entry) => entry.subject.startsWith(prefix2) && Date.parse(entry.receivedAt) >= started - EARLY_MS2 && input2.reported?.has(entry.eventId) !== true);
376994
- const answered = mine.find((entry) => entry.disposition === "answered");
376995
- if (answered !== void 0) {
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
- }
377055
+ const reply = settledReply(mine, input2);
377056
+ if (reply !== void 0) return reply;
377005
377057
  if (input2.now() - started >= timeout) {
377006
377058
  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
377059
  }
@@ -377314,19 +377366,29 @@ function linkBlock(link) {
377314
377366
  return wrap;
377315
377367
  }
377316
377368
 
377317
- function commandRow(command) {
377318
- const row = el("div", "command");
377369
+ function copyButton(text) {
377319
377370
  const copy = el("button", "", "Copy");
377320
377371
  copy.type = "button";
377321
377372
  copy.addEventListener("click", () => {
377322
377373
  const done = () => { copy.textContent = "Copied"; };
377323
377374
  const failed = () => { copy.textContent = "Select it and copy"; };
377324
- if (navigator.clipboard) navigator.clipboard.writeText(command.command).then(done, failed); else failed();
377375
+ if (navigator.clipboard) navigator.clipboard.writeText(text).then(done, failed); else failed();
377325
377376
  });
377326
- row.append(el("span", "", command.label + ":"), el("code", "", command.command), copy);
377377
+ return copy;
377378
+ }
377379
+
377380
+ function commandRow(command) {
377381
+ const row = el("div", "command");
377382
+ row.append(el("span", "", command.label + ":"), el("code", "", command.command), copyButton(command.command));
377327
377383
  return row;
377328
377384
  }
377329
377385
 
377386
+ function promptBlock(prompt) {
377387
+ const buttons = el("div", "buttons");
377388
+ buttons.append(copyButton(prompt.text));
377389
+ return [el("h3", "", prompt.label), el("pre", "", prompt.text), buttons];
377390
+ }
377391
+
377330
377392
  function detailsBlock(lines) {
377331
377393
  const details = el("details");
377332
377394
  details.append(el("summary", "", "Technical details"));
@@ -377394,6 +377456,7 @@ function renderCard(card) {
377394
377456
  group = command.group;
377395
377457
  section.append(commandRow(command));
377396
377458
  }
377459
+ if (card.prompt) section.append(...promptBlock(card.prompt));
377397
377460
  if (card.id === "ready" && !installerClosed) {
377398
377461
  const buttons = el("div", "buttons");
377399
377462
  const close = el("button", "primary", "Close installer");
@@ -379131,7 +379194,10 @@ function readyText(input2) {
379131
379194
  ` More projects: ${cli("project add")}, then ${cli("channel add")}.`,
379132
379195
  ` Send a test alarm any time: ${cli("alerts test")}.`,
379133
379196
  // The plan points here for removing everything, on the terminal path (--no-ui, --yes) too.
379134
- ` Remove it: ${cli("destroy")}. It deletes the coding machines' disks too.`
379197
+ ` Remove it: ${cli("destroy")}. It deletes the coding machines' disks too.`,
379198
+ "",
379199
+ `${AI_TOOL_PROMPT_LABEL}:`,
379200
+ aiToolPrompt(input2)
379135
379201
  ].join("\n");
379136
379202
  }
379137
379203
 
@@ -379450,7 +379516,7 @@ init_dist2();
379450
379516
  init_cdk_source();
379451
379517
  import { chmod as chmod6, lstat as lstat2, mkdir as mkdir10, mkdtemp as mkdtemp5, readFile as readFile21, readdir as readdir5, realpath as realpath6, rename as rename7, rm as rm11, writeFile as writeFile7 } from "node:fs/promises";
379452
379518
  import { dirname as dirname8, join as join21, sep as sep5 } from "node:path";
379453
- var RELEASE_REPOSITORY = "PrepLabsAI/Rovara";
379519
+ var RELEASE_REPOSITORY = "PrepLabsAI/Rovara-Code";
379454
379520
  function releaseAssetUrls(version3) {
379455
379521
  const base2 = `https://github.com/${RELEASE_REPOSITORY}/releases/download/v${version3}`;
379456
379522
  return { tarball: `${base2}/agentx-${version3}.tar.gz`, manifest: `${base2}/release.json` };
@@ -381824,6 +381890,7 @@ async function init(options, deps, services, session) {
381824
381890
  if (surface !== void 0 && settings !== void 0 && progress !== void 0) {
381825
381891
  surface.card(readyCard({
381826
381892
  env: env3,
381893
+ region,
381827
381894
  controlPlaneUrl: settings.controlPlaneUrl,
381828
381895
  progress,
381829
381896
  botName: botNameOf(progress, finalAnswers.slack.appName),
@@ -381842,6 +381909,7 @@ async function init(options, deps, services, session) {
381842
381909
  ...settings === void 0 || progress === void 0 ? {} : {
381843
381910
  ready: readyText({
381844
381911
  env: env3,
381912
+ region,
381845
381913
  controlPlaneUrl: settings.controlPlaneUrl,
381846
381914
  progress,
381847
381915
  botName: botNameOf(progress, finalAnswers.slack.appName),
@@ -388943,6 +389011,10 @@ function environmentSsmClient(region) {
388943
389011
  return new import_client_ssm4.SSMClient(region === void 0 ? {} : { region });
388944
389012
  }
388945
389013
  var DEFAULT_CALLBACK_PORT = 8765;
389014
+ var ROOT_HELP_DOCS_LINES = [
389015
+ "Docs: https://github.com/PrepLabsAI/Rovara-Code/blob/mainline/docs/cli-reference.md",
389016
+ "Docs for AI agents: https://rovara.dev/llms.txt"
389017
+ ];
388946
389018
  function createCliProgram(dependencies = {}) {
388947
389019
  const services = {
388948
389020
  fetchImplementation: dependencies.fetchImplementation ?? fetch,
@@ -388987,7 +389059,8 @@ function createCliProgram(dependencies = {}) {
388987
389059
  return stored !== void 0 && stored.expiresAt > Date.now() ? stored : void 0;
388988
389060
  }
388989
389061
  const developerSession = () => ({ home, tokenStore: services.tokenStore, fetch: services.fetchImplementation });
388990
- const program2 = new Command2().name(CLI_COMMAND_NAME).description("Rovara Code: sign in, deploy and administer your coding-agent workspace; hand off tasks from your coding tool or Slack").version(CLI_VERSION).option("--project <project-name>", "select a locally configured AgentX project").option("--config-dir <directory>", "project configuration directory", join33(homedir4(), ".agentx/projects")).option("--deployment-file <path>", "AgentX deployment settings; defaults to this environment's local cache, or, for production, ~/.agentx/deployment.yaml").option("--env <name>", "AgentX environment", DEFAULT_ENVIRONMENT).option("--allow-loopback", "allow loopback HTTP endpoints for local testing only", false).option("--accept-unchecked-model <reason>", "register a project whose default model failed its check anyway (project add, setup-approve, connector add, admin project register); the reason is recorded with the revision").option("--json", "emit stable machine-readable output", false);
389062
+ const program2 = new Command2().name(CLI_COMMAND_NAME).description("Rovara Code: sign in, deploy and administer your coding-agent workspace; hand off tasks from your coding tool or Slack").version(CLI_VERSION).option("--project <project-name>", "select a locally configured AgentX project").option("--config-dir <directory>", "project configuration directory", join33(homedir4(), ".agentx/projects")).option("--deployment-file <path>", "AgentX deployment settings; defaults to this environment's local cache, or, for production, ~/.agentx/deployment.yaml").option("--env <name>", "AgentX environment", DEFAULT_ENVIRONMENT).option("--allow-loopback", "allow loopback HTTP endpoints for local testing only", false).option("--accept-unchecked-model <reason>", "register a project whose default model failed its check anyway (project add, setup-approve, connector add, admin project register); the reason is recorded with the revision").option("--json", "emit stable machine-readable output", false).addHelpText("after", `
389063
+ ${ROOT_HELP_DOCS_LINES.join("\n")}`);
388991
389064
  program2.hook("preAction", (_program, actionCommand) => {
388992
389065
  const { env: env3 } = actionCommand.optsWithGlobals();
388993
389066
  const parsed = EnvironmentNameSchema.safeParse(env3);
@@ -390008,6 +390081,7 @@ if (isDirectExecution()) {
390008
390081
  }
390009
390082
  export {
390010
390083
  DEFAULT_CALLBACK_PORT,
390084
+ ROOT_HELP_DOCS_LINES,
390011
390085
  createCliProgram,
390012
390086
  environmentAdoptClients,
390013
390087
  environmentSsmClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preplabsai/rovara-code",
3
- "version": "0.5.8",
3
+ "version": "0.5.11",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rovara": "bin/agentx.mjs",
@@ -26,6 +26,6 @@
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "git+https://github.com/PrepLabsAI/Rovara.git"
29
+ "url": "git+https://github.com/PrepLabsAI/Rovara-Code.git"
30
30
  }
31
31
  }