@artifactshare/cli 0.11.0 → 0.11.1

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/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ For user-facing announcements, see https://artifactshare.com/updates?product=cli
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.11.1 - 2026-08-12
9
+
10
+ - Warn in `doctor` when an agent credential's approved project differs from the configured default destination, and provide an `init` command to align them.
11
+
8
12
  ## 0.11.0 - 2026-08-12
9
13
 
10
14
  - Add `login --preset agent` for browser-approved credentials restricted to one project, with scoped defaults and guidance across login, `whoami`, and `doctor`.
package/dist/index.js CHANGED
@@ -3536,6 +3536,7 @@ function resolveDoctorNextCommand(data) {
3536
3536
  return LOGIN_COMMAND;
3537
3537
  }
3538
3538
  if ((data.auth.code === "auth_required" || data.auth.code === "token_invalid") && !bearerTokenBlocksLogin(data)) return data.auth.profile ? `${LOGIN_COMMAND} --profile ${data.auth.profile}` : LOGIN_COMMAND;
3539
+ if (data.destination.ok && data.destination.code === "agent_scope_mismatch") return data.destination.approved_project_id && data.auth.profile ? `${CLI_INVOCATION} init --profile ${data.auth.profile} --project-id ${data.destination.approved_project_id} --json` : null;
3539
3540
  return null;
3540
3541
  }
3541
3542
  function authRecovery(data, nextCommand) {
@@ -3640,6 +3641,9 @@ async function runDoctor(parsed, mode) {
3640
3641
  if (!body) throw new Error("Doctor response was not valid JSON.");
3641
3642
  data.auth.ok = body.auth?.ok ?? true;
3642
3643
  data.auth.email = body.user?.email ?? null;
3644
+ const authority = doctorAuthority(body.auth?.authority);
3645
+ if (authority) data.auth.authority = authority;
3646
+ applyAgentDestinationDiagnostic(data, authority);
3643
3647
  data.upload.checked = true;
3644
3648
  data.upload.ok = body.upload?.ok ?? false;
3645
3649
  if (!data.upload.ok) {
@@ -3648,6 +3652,30 @@ async function runDoctor(parsed, mode) {
3648
3652
  }
3649
3653
  return writeSuccess(command, doctorDataWithNextCommand(data), mode);
3650
3654
  }
3655
+ function doctorAuthority(value) {
3656
+ if (!value || typeof value !== "object") return null;
3657
+ const authority = value;
3658
+ if (authority.preset === "agent" && typeof authority.project_id === "string" && authority.project_id) return {
3659
+ preset: "agent",
3660
+ project_id: authority.project_id
3661
+ };
3662
+ if (authority.preset === "unrestricted" && (authority.project_id === null || authority.project_id === void 0)) return {
3663
+ preset: "unrestricted",
3664
+ project_id: null
3665
+ };
3666
+ return null;
3667
+ }
3668
+ function applyAgentDestinationDiagnostic(data, authority) {
3669
+ if (authority?.preset !== "agent" || !authority.project_id || !data.destination.ok || data.destination.project_id === authority.project_id) return;
3670
+ data.destination = {
3671
+ ok: true,
3672
+ type: data.destination.type,
3673
+ project_id: data.destination.project_id,
3674
+ approved_project_id: authority.project_id,
3675
+ code: "agent_scope_mismatch",
3676
+ hint: data.auth.profile ? `The configured default destination is outside this agent credential's approved project. Run ${CLI_INVOCATION} init --profile ${data.auth.profile} --project-id ${authority.project_id} --json to use the approved project by default.` : `The configured default destination is outside this agent credential's approved project. Pass --project-id ${authority.project_id} when sharing.`
3677
+ };
3678
+ }
3651
3679
  async function configDiagnostics(project) {
3652
3680
  const globalConfig = await readGlobalConfig();
3653
3681
  const cwd = process.cwd();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artifactshare/cli",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Upload and share HTML, Markdown, folders, and static sites from terminals, AI agents, automation, and CI.",
5
5
  "homepage": "https://artifactshare.com/connect",
6
6
  "repository": {