@agentclientprotocol/claude-agent-acp 0.107.2-preview.3 → 0.107.2-preview.4

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.
@@ -57,8 +57,8 @@ export declare const CLAUDE_LOGIN_REQUIRED_MESSAGE = "Sign in with an API key or
57
57
  * proves it, and an unknown value keeps the guard on.
58
58
  *
59
59
  * - `subscriptionType` must be set. Without it the CLI reports no subscription.
60
- * - `tokenSource` must be absent. The CLI sets it in place of the subscription
61
- * when a bearer or OAuth environment token pays for the turn.
60
+ * - `tokenSource` must be absent, empty, or `none`. A bearer or OAuth
61
+ * environment token takes precedence over the subscription.
62
62
  * - `apiProvider` must be absent or `firstParty`. The SDK documents that the
63
63
  * Anthropic OAuth login applies only to `firstParty`; for a third-party
64
64
  * backend such as `bedrock`, `vertex`, `foundry` or `gateway` the other
@@ -1 +1 @@
1
- {"version":3,"file":"hide-claude-auth.d.ts","sourceRoot":"","sources":["../src/hide-claude-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEzE,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;AAE1D,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wCAAwC,sCAAsC,CAAC;AAC5F,MAAM,MAAM,kBAAkB,GAAG,OAAO,wCAAwC,CAAC;AAEjF,eAAO,MAAM,yCAAyC,qEACc,CAAC;AAErE;;qEAEqE;AACrE,eAAO,MAAM,6BAA6B,0EAC+B,CAAC;AAmB1E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAWjF;AAED;;;;;;;;;GAS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,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,4BAA4B,CAAC;IACzC,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAWP;AAED,KAAK,YAAY,GAAG;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAClC,UAAU,EAAE,4BAA4B,CAAC;IACzC,MAAM,EAAE,WAAW,CAAC;IACpB;;;;+BAI2B;IAC3B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAavF"}
@@ -65,6 +65,10 @@ const API_KEY_SOURCES_ABOVE_SUBSCRIPTION = new Set([
65
65
  "apiKeyHelper",
66
66
  "/login managed key",
67
67
  ]);
68
+ /** `none` is the SDK's explicit no-token source. */
69
+ function hasTokenSource(account) {
70
+ return Boolean(account.tokenSource && account.tokenSource !== "none");
71
+ }
68
72
  /**
69
73
  * True when a turn on this account is paid by a claude.ai subscription.
70
74
  *
@@ -73,8 +77,8 @@ const API_KEY_SOURCES_ABOVE_SUBSCRIPTION = new Set([
73
77
  * proves it, and an unknown value keeps the guard on.
74
78
  *
75
79
  * - `subscriptionType` must be set. Without it the CLI reports no subscription.
76
- * - `tokenSource` must be absent. The CLI sets it in place of the subscription
77
- * when a bearer or OAuth environment token pays for the turn.
80
+ * - `tokenSource` must be absent, empty, or `none`. A bearer or OAuth
81
+ * environment token takes precedence over the subscription.
78
82
  * - `apiProvider` must be absent or `firstParty`. The SDK documents that the
79
83
  * Anthropic OAuth login applies only to `firstParty`; for a third-party
80
84
  * backend such as `bedrock`, `vertex`, `foundry` or `gateway` the other
@@ -87,7 +91,7 @@ export function billsClaudeSubscription(account) {
87
91
  if (!account?.subscriptionType) {
88
92
  return false;
89
93
  }
90
- if (account.tokenSource) {
94
+ if (hasTokenSource(account)) {
91
95
  return false;
92
96
  }
93
97
  if (account.apiProvider !== undefined && account.apiProvider !== "firstParty") {
@@ -112,7 +116,7 @@ export function holdsNonSubscriptionCredential(account) {
112
116
  if (account.apiProvider !== undefined && account.apiProvider !== "firstParty") {
113
117
  return true;
114
118
  }
115
- if (account.tokenSource) {
119
+ if (hasTokenSource(account)) {
116
120
  return true;
117
121
  }
118
122
  return API_KEY_SOURCES_ABOVE_SUBSCRIPTION.has(account.apiKeySource ?? "");
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.107.2-preview.3",
6
+ "version": "0.107.2-preview.4",
7
7
  "description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
8
8
  "main": "dist/lib.js",
9
9
  "types": "dist/lib.d.ts",