@preplabsai/rovara-code 0.5.6 → 0.5.8

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 +26 -5
  2. package/package.json +1 -1
@@ -21887,8 +21887,19 @@ function environmentRoles(scope2) {
21887
21887
  function environmentInstanceProfiles(scope2) {
21888
21888
  return `arn:${scope2.partition}:iam::${scope2.account}:instance-profile${environmentRolePath(scope2.env)}*`;
21889
21889
  }
21890
+ function savedEnvPushPullLookupPattern(env3) {
21891
+ const push = savedEnvPushRoleName(env3);
21892
+ const pull = savedEnvPullRoleName(env3);
21893
+ const pattern = `${push.slice(0, -2)}??`;
21894
+ if (pull.length !== push.length || !pull.startsWith(push.slice(0, -2)))
21895
+ throw new Error(`the image push and pull role names no longer share one lookup pattern: ${push}, ${pull}`);
21896
+ return pattern;
21897
+ }
21898
+ function namedBrokerRoleName(env3) {
21899
+ return `agentx-${env3}-broker-role`;
21900
+ }
21890
21901
  function brokerRoleArn(scope2) {
21891
- return `arn:${scope2.partition}:iam::${scope2.account}:role${environmentRolePath(scope2.env)}agentx-${scope2.env}-broker-role`;
21902
+ return `arn:${scope2.partition}:iam::${scope2.account}:role${environmentRolePath(scope2.env)}${namedBrokerRoleName(scope2.env)}`;
21892
21903
  }
21893
21904
  function savedEnvSessionRoleArns(scope2) {
21894
21905
  return [savedEnvPushRoleName(scope2.env), savedEnvPullRoleName(scope2.env), savedEnvManageRoleName(scope2.env)].map((name3) => `arn:${scope2.partition}:iam::${scope2.account}:role${environmentRolePath(scope2.env)}${name3}`);
@@ -21923,7 +21934,16 @@ function fixedNameRoleLookupStatement(scope2) {
21923
21934
  Effect: "Allow",
21924
21935
  Action: [...FIXED_NAME_ROLE_LOOKUP_ACTIONS],
21925
21936
  // R5 step 1: the Slack token reader role is fixed-name too (contracts slack-company-tokens.ts), so its lookup is listed with the three image roles and (PRIVATE-PACKAGES P1b) the company-secrets role.
21926
- Resource: [...[savedEnvPushRoleName(scope2.env), savedEnvPullRoleName(scope2.env), savedEnvManageRoleName(scope2.env), companySecretsRoleName(scope2.env)].map((name3) => `arn:${scope2.partition}:iam::${scope2.account}:role/${name3}`), slackTokenReaderLookupResource(scope2)]
21937
+ // #1579: and the broker's role, fixed-name in named environments since fc5df010e (infra control-plane.ts brokerRoleName): without it a fresh install's control plane
21938
+ // failed on iam:GetRole for agentx-<env>-broker-role and its rollback on iam:DetachRolePolicy. An install that already has the role never hit it (its lookup finds the path).
21939
+ // The image push and pull roles share one pattern, `agentx-<env>-img-pu??` (IAM's `?` is exactly one character), so the broker's entry fits the deploy boundary's
21940
+ // 6,144-character limit at the longest environment name on the longest partition. It names exactly those two: no other role of this or any environment has that shape.
21941
+ Resource: [
21942
+ `arn:${scope2.partition}:iam::${scope2.account}:role/${savedEnvPushPullLookupPattern(scope2.env)}`,
21943
+ ...[savedEnvManageRoleName(scope2.env), companySecretsRoleName(scope2.env)].map((name3) => `arn:${scope2.partition}:iam::${scope2.account}:role/${name3}`),
21944
+ slackTokenReaderLookupResource(scope2),
21945
+ `arn:${scope2.partition}:iam::${scope2.account}:role/${namedBrokerRoleName(scope2.env)}`
21946
+ ]
21927
21947
  };
21928
21948
  }
21929
21949
  function ecrTemplateServiceLinkedRoleStatement(scope2) {
@@ -367591,7 +367611,7 @@ init_dist2();
367591
367611
  import { realpathSync } from "node:fs";
367592
367612
 
367593
367613
  // packages/cli/src/version.ts
367594
- var RELEASE_VERSION = true ? "0.5.6" : void 0;
367614
+ var RELEASE_VERSION = true ? "0.5.8" : void 0;
367595
367615
  var CLI_VERSION = RELEASE_VERSION ?? "0.1.0";
367596
367616
  function isPrereleaseVersion(version3) {
367597
367617
  return /^\d+\.\d+\.\d+-/.test(version3);
@@ -369728,8 +369748,9 @@ function templatesDeployer(input2) {
369728
369748
  const text11 = installTemplate(request);
369729
369749
  const declared = declaredParameterNames(text11);
369730
369750
  if (request.part === "access") {
369731
- if (Buffer.byteLength(text11, "utf8") > MAX_INLINE_TEMPLATE_BYTES) throw new Error("the access template is too large to deploy inline");
369732
- return { source: { TemplateBody: text11 }, declared };
369751
+ const body = JSON.stringify(JSON.parse(text11));
369752
+ if (Buffer.byteLength(body, "utf8") > MAX_INLINE_TEMPLATE_BYTES) throw new Error(`the access template is too large to deploy inline (${Buffer.byteLength(body, "utf8")} bytes minified; the limit is ${MAX_INLINE_TEMPLATE_BYTES})`);
369753
+ return { source: { TemplateBody: body }, declared };
369733
369754
  }
369734
369755
  const bucket = input2.artifactBucket();
369735
369756
  await uploadPackages(request, bucket, emit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preplabsai/rovara-code",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rovara": "bin/agentx.mjs",