@autohq/cli 0.1.105 → 0.1.106

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,
@@ -21630,7 +21637,14 @@ var SessionPresenceIdentitySchema = external_exports.object({
21630
21637
  // the presence icon endpoint.
21631
21638
  avatarSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
21632
21639
  avatarUrl: external_exports.string().trim().min(1).optional(),
21633
- appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional()
21640
+ appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
21641
+ /**
21642
+ * Scopes the current agent-app scope set requests that this realized
21643
+ * identity's install never granted. Computed at read time; non-empty means
21644
+ * the install predates a scope addition and `auto sessions connect
21645
+ * <session> --reconnect` refreshes it.
21646
+ */
21647
+ missingScopes: external_exports.array(external_exports.string().trim().min(1)).optional()
21634
21648
  });
21635
21649
  var SessionPresenceResponseSchema = external_exports.object({
21636
21650
  session: ResourceNameSchema,
@@ -26191,7 +26205,7 @@ Object.assign(lookup, {
26191
26205
  // package.json
26192
26206
  var package_default = {
26193
26207
  name: "@autohq/cli",
26194
- version: "0.1.105",
26208
+ version: "0.1.106",
26195
26209
  license: "SEE LICENSE IN README.md",
26196
26210
  publishConfig: {
26197
26211
  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,
@@ -17572,7 +17579,14 @@ var init_sessions = __esm({
17572
17579
  // the presence icon endpoint.
17573
17580
  avatarSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
17574
17581
  avatarUrl: external_exports.string().trim().min(1).optional(),
17575
- appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional()
17582
+ appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
17583
+ /**
17584
+ * Scopes the current agent-app scope set requests that this realized
17585
+ * identity's install never granted. Computed at read time; non-empty means
17586
+ * the install predates a scope addition and `auto sessions connect
17587
+ * <session> --reconnect` refreshes it.
17588
+ */
17589
+ missingScopes: external_exports.array(external_exports.string().trim().min(1)).optional()
17576
17590
  });
17577
17591
  SessionPresenceResponseSchema = external_exports.object({
17578
17592
  session: ResourceNameSchema,
@@ -18497,7 +18511,7 @@ var init_package = __esm({
18497
18511
  "package.json"() {
18498
18512
  package_default = {
18499
18513
  name: "@autohq/cli",
18500
- version: "0.1.105",
18514
+ version: "0.1.106",
18501
18515
  license: "SEE LICENSE IN README.md",
18502
18516
  publishConfig: {
18503
18517
  access: "public"
@@ -29431,7 +29445,7 @@ function connectionRows(connections, style) {
29431
29445
  provider: connection.provider,
29432
29446
  account: connection.externalAccount.loginOrName,
29433
29447
  grant: grant.name,
29434
- status: grant.status,
29448
+ status: stale(grant) ? "reconnect needed" : grant.status,
29435
29449
  projects: projectSummary({
29436
29450
  ...connection,
29437
29451
  projectAccess: connection.projectAccess.filter(
@@ -29473,7 +29487,23 @@ function connectionRows(connections, style) {
29473
29487
  grantStatusStyle(style, row.status)(row.status.padEnd(widths.status)),
29474
29488
  style.dim(row.projects)
29475
29489
  ].join(" ");
29476
- return [style.heading(headerLine), ...rows.map(format)];
29490
+ return [
29491
+ style.heading(headerLine),
29492
+ ...rows.map(format),
29493
+ ...staleGrantNotices(connections, style)
29494
+ ];
29495
+ }
29496
+ function staleGrantNotices(connections, style) {
29497
+ return connections.flatMap(
29498
+ (connection) => connection.grants.filter(stale).map(
29499
+ (grant) => style.warn(
29500
+ `grant ${grant.name}: installed before scopes ${(grant.missingScopes ?? []).join(", ")} were added \u2014 re-run \`auto connect ${connection.provider}\` to re-consent`
29501
+ )
29502
+ )
29503
+ );
29504
+ }
29505
+ function stale(grant) {
29506
+ return grant.status === "active" && (grant.missingScopes?.length ?? 0) > 0;
29477
29507
  }
29478
29508
  function providerRows(providers, style) {
29479
29509
  if (providers.length === 0) {
@@ -29514,6 +29544,8 @@ function grantStatusStyle(style, status) {
29514
29544
  switch (status) {
29515
29545
  case "active":
29516
29546
  return style.success;
29547
+ case "reconnect needed":
29548
+ return style.warn;
29517
29549
  case "error":
29518
29550
  return style.error;
29519
29551
  case "revoked":
@@ -32184,6 +32216,10 @@ async function connectSessionPresence2(input) {
32184
32216
  input.writeOutput(result.message);
32185
32217
  for (const identity2 of result.realized) {
32186
32218
  input.writeOutput(realizedIdentityLine(input.session, identity2));
32219
+ const staleNotice = staleScopesLine(input.session, identity2);
32220
+ if (staleNotice) {
32221
+ input.writeOutput(staleNotice);
32222
+ }
32187
32223
  }
32188
32224
  if (result.pending.length === 0) {
32189
32225
  await promptForIconUploads(input, options);
@@ -32262,6 +32298,12 @@ function realizedIdentityLine(session, identity2) {
32262
32298
  const handle = identity2.botUsername ? `persona/@${identity2.botUsername}` : `bot/${identity2.botUserId ?? ""}`;
32263
32299
  return `connected session/${session} workspace/${identity2.workspace} ${handle}`;
32264
32300
  }
32301
+ function staleScopesLine(session, identity2) {
32302
+ if (!identity2.missingScopes?.length) {
32303
+ return void 0;
32304
+ }
32305
+ return ` workspace "${identity2.workspace}" was installed before scopes ${identity2.missingScopes.join(", ")} were added; refresh with \`auto sessions connect ${session} --reconnect\``;
32306
+ }
32265
32307
  function manualGuidance(input) {
32266
32308
  if (input.allTelegram) {
32267
32309
  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.106",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"