@autohq/cli 0.1.105 → 0.1.107

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.
@@ -19873,7 +19873,14 @@ var ProviderGrantSchema = external_exports.object({
19873
19873
  providerResourceSelection: ProviderResourceSelectionSchema.default({
19874
19874
  kind: "all"
19875
19875
  }),
19876
- status: ProviderGrantStatusSchema
19876
+ status: ProviderGrantStatusSchema,
19877
+ /**
19878
+ * Scopes the server's current configuration requests that this grant has
19879
+ * not granted. Computed at read time against the deployed scope list, never
19880
+ * stored; present and non-empty only when a re-consent (`auto connect
19881
+ * <provider>`) is needed to pick up scopes added since the install.
19882
+ */
19883
+ missingScopes: external_exports.array(external_exports.string().trim().min(1)).optional()
19877
19884
  });
19878
19885
  var ProjectProviderAccessSchema = external_exports.object({
19879
19886
  providerGrantId: ProviderGrantIdSchema,
@@ -20836,7 +20843,8 @@ var SecretAesGcmAuthTagSchema = external_exports.string().trim().regex(/^[A-Za-z
20836
20843
  var SecretEnvValueSchema = external_exports.union([
20837
20844
  external_exports.string(),
20838
20845
  external_exports.object({
20839
- $secret: ResourceNameSchema
20846
+ $secret: ResourceNameSchema,
20847
+ optional: external_exports.boolean().optional()
20840
20848
  })
20841
20849
  ]);
20842
20850
  var SecretEnvSchema = external_exports.record(
@@ -21630,7 +21638,14 @@ var SessionPresenceIdentitySchema = external_exports.object({
21630
21638
  // the presence icon endpoint.
21631
21639
  avatarSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
21632
21640
  avatarUrl: external_exports.string().trim().min(1).optional(),
21633
- appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional()
21641
+ appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
21642
+ /**
21643
+ * Scopes the current agent-app scope set requests that this realized
21644
+ * identity's install never granted. Computed at read time; non-empty means
21645
+ * the install predates a scope addition and `auto sessions connect
21646
+ * <session> --reconnect` refreshes it.
21647
+ */
21648
+ missingScopes: external_exports.array(external_exports.string().trim().min(1)).optional()
21634
21649
  });
21635
21650
  var SessionPresenceResponseSchema = external_exports.object({
21636
21651
  session: ResourceNameSchema,
@@ -26191,7 +26206,7 @@ Object.assign(lookup, {
26191
26206
  // package.json
26192
26207
  var package_default = {
26193
26208
  name: "@autohq/cli",
26194
- version: "0.1.105",
26209
+ version: "0.1.107",
26195
26210
  license: "SEE LICENSE IN README.md",
26196
26211
  publishConfig: {
26197
26212
  access: "public"
package/dist/index.js CHANGED
@@ -15410,7 +15410,14 @@ var init_provider_grants = __esm({
15410
15410
  providerResourceSelection: ProviderResourceSelectionSchema.default({
15411
15411
  kind: "all"
15412
15412
  }),
15413
- status: ProviderGrantStatusSchema
15413
+ status: ProviderGrantStatusSchema,
15414
+ /**
15415
+ * Scopes the server's current configuration requests that this grant has
15416
+ * not granted. Computed at read time against the deployed scope list, never
15417
+ * stored; present and non-empty only when a re-consent (`auto connect
15418
+ * <provider>`) is needed to pick up scopes added since the install.
15419
+ */
15420
+ missingScopes: external_exports.array(external_exports.string().trim().min(1)).optional()
15414
15421
  });
15415
15422
  ProjectProviderAccessSchema = external_exports.object({
15416
15423
  providerGrantId: ProviderGrantIdSchema,
@@ -16524,7 +16531,8 @@ var init_secrets = __esm({
16524
16531
  SecretEnvValueSchema = external_exports.union([
16525
16532
  external_exports.string(),
16526
16533
  external_exports.object({
16527
- $secret: ResourceNameSchema
16534
+ $secret: ResourceNameSchema,
16535
+ optional: external_exports.boolean().optional()
16528
16536
  })
16529
16537
  ]);
16530
16538
  SecretEnvSchema = external_exports.record(
@@ -17572,7 +17580,14 @@ var init_sessions = __esm({
17572
17580
  // the presence icon endpoint.
17573
17581
  avatarSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
17574
17582
  avatarUrl: external_exports.string().trim().min(1).optional(),
17575
- appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional()
17583
+ appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
17584
+ /**
17585
+ * Scopes the current agent-app scope set requests that this realized
17586
+ * identity's install never granted. Computed at read time; non-empty means
17587
+ * the install predates a scope addition and `auto sessions connect
17588
+ * <session> --reconnect` refreshes it.
17589
+ */
17590
+ missingScopes: external_exports.array(external_exports.string().trim().min(1)).optional()
17576
17591
  });
17577
17592
  SessionPresenceResponseSchema = external_exports.object({
17578
17593
  session: ResourceNameSchema,
@@ -18497,7 +18512,7 @@ var init_package = __esm({
18497
18512
  "package.json"() {
18498
18513
  package_default = {
18499
18514
  name: "@autohq/cli",
18500
- version: "0.1.105",
18515
+ version: "0.1.107",
18501
18516
  license: "SEE LICENSE IN README.md",
18502
18517
  publishConfig: {
18503
18518
  access: "public"
@@ -29431,7 +29446,7 @@ function connectionRows(connections, style) {
29431
29446
  provider: connection.provider,
29432
29447
  account: connection.externalAccount.loginOrName,
29433
29448
  grant: grant.name,
29434
- status: grant.status,
29449
+ status: stale(grant) ? "reconnect needed" : grant.status,
29435
29450
  projects: projectSummary({
29436
29451
  ...connection,
29437
29452
  projectAccess: connection.projectAccess.filter(
@@ -29473,7 +29488,23 @@ function connectionRows(connections, style) {
29473
29488
  grantStatusStyle(style, row.status)(row.status.padEnd(widths.status)),
29474
29489
  style.dim(row.projects)
29475
29490
  ].join(" ");
29476
- return [style.heading(headerLine), ...rows.map(format)];
29491
+ return [
29492
+ style.heading(headerLine),
29493
+ ...rows.map(format),
29494
+ ...staleGrantNotices(connections, style)
29495
+ ];
29496
+ }
29497
+ function staleGrantNotices(connections, style) {
29498
+ return connections.flatMap(
29499
+ (connection) => connection.grants.filter(stale).map(
29500
+ (grant) => style.warn(
29501
+ `grant ${grant.name}: installed before scopes ${(grant.missingScopes ?? []).join(", ")} were added \u2014 re-run \`auto connect ${connection.provider}\` to re-consent`
29502
+ )
29503
+ )
29504
+ );
29505
+ }
29506
+ function stale(grant) {
29507
+ return grant.status === "active" && (grant.missingScopes?.length ?? 0) > 0;
29477
29508
  }
29478
29509
  function providerRows(providers, style) {
29479
29510
  if (providers.length === 0) {
@@ -29514,6 +29545,8 @@ function grantStatusStyle(style, status) {
29514
29545
  switch (status) {
29515
29546
  case "active":
29516
29547
  return style.success;
29548
+ case "reconnect needed":
29549
+ return style.warn;
29517
29550
  case "error":
29518
29551
  return style.error;
29519
29552
  case "revoked":
@@ -32184,6 +32217,10 @@ async function connectSessionPresence2(input) {
32184
32217
  input.writeOutput(result.message);
32185
32218
  for (const identity2 of result.realized) {
32186
32219
  input.writeOutput(realizedIdentityLine(input.session, identity2));
32220
+ const staleNotice = staleScopesLine(input.session, identity2);
32221
+ if (staleNotice) {
32222
+ input.writeOutput(staleNotice);
32223
+ }
32187
32224
  }
32188
32225
  if (result.pending.length === 0) {
32189
32226
  await promptForIconUploads(input, options);
@@ -32262,6 +32299,12 @@ function realizedIdentityLine(session, identity2) {
32262
32299
  const handle = identity2.botUsername ? `persona/@${identity2.botUsername}` : `bot/${identity2.botUserId ?? ""}`;
32263
32300
  return `connected session/${session} workspace/${identity2.workspace} ${handle}`;
32264
32301
  }
32302
+ function staleScopesLine(session, identity2) {
32303
+ if (!identity2.missingScopes?.length) {
32304
+ return void 0;
32305
+ }
32306
+ return ` workspace "${identity2.workspace}" was installed before scopes ${identity2.missingScopes.join(", ")} were added; refresh with \`auto sessions connect ${session} --reconnect\``;
32307
+ }
32265
32308
  function manualGuidance(input) {
32266
32309
  if (input.allTelegram) {
32267
32310
  return `Open each creation link and confirm the new bot in Telegram; Auto provisions it automatically. Re-run \`auto sessions connect ${input.session}\` (or check presence) to see it realize.`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.105",
3
+ "version": "0.1.107",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"