@cortexkit/pi-anthropic-auth 2.0.0 → 2.0.2

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/dist/index.js CHANGED
@@ -77,6 +77,7 @@ export default async function cortexKitPiAnthropicAuth(pi, options = {}) {
77
77
  effortHistoryBySession.delete(sessionId);
78
78
  await closePiNativeRuntime(storagePath);
79
79
  });
80
+ // Keep the catalog chat-only even when Pi also accepts image/classifier models.
80
81
  const configuration = {
81
82
  name: 'Anthropic (CortexKit OAuth)',
82
83
  baseUrl: 'https://api.anthropic.com',
@@ -275,8 +276,8 @@ export default async function cortexKitPiAnthropicAuth(pi, options = {}) {
275
276
  getModels: () => (configuration.models ?? []).map((model) => ({
276
277
  ...model,
277
278
  provider: 'anthropic',
278
- api: model.api ?? 'cortexkit-anthropic-messages',
279
- baseUrl: model.baseUrl ?? 'https://api.anthropic.com',
279
+ api: configuration.api,
280
+ baseUrl: configuration.baseUrl,
280
281
  })),
281
282
  // Preserve the legacy provider's simplified option surface for raw calls.
282
283
  stream: (model, context, options) => streamSimple(model, context, options),
@@ -5,20 +5,12 @@ import { getPiNativeRuntime } from './native.js';
5
5
  import { getPiAccountStoragePath } from './paths.js';
6
6
  import { clearPiStickyRoutingSession, getPiTrackedCacheKeepSessions, } from './stream.js';
7
7
  import { fetchPiOAuth } from './transport.js';
8
- function record(value) {
9
- return value && typeof value === 'object' && !Array.isArray(value)
10
- ? value
11
- : {};
12
- }
13
8
  export function createPiNativeCommands(storagePath = getPiAccountStoragePath()) {
14
9
  const native = getPiNativeRuntime(storagePath);
15
10
  const custody = createPiCustodyCommands();
16
11
  const pending = new Map();
17
12
  const setSection = async (key, patch) => {
18
- await (await native.service()).updateSettings((settings) => ({
19
- ...settings,
20
- [key]: { ...record(settings[key]), ...patch },
21
- }));
13
+ await (await native.service()).updateSettings((settings) => mergeNativeSettingsSection(settings, key, patch));
22
14
  };
23
15
  const setLimits = async (entries) => {
24
16
  const snapshot = await native.view();
@@ -227,13 +219,7 @@ export function createPiNativeCommands(storagePath = getPiAccountStoragePath())
227
219
  await setSection('claudeCache', { mode: request.values.mode });
228
220
  return { ok: true, text: 'Native prompt cache mode updated.' };
229
221
  case 'cachekeep-always':
230
- await runtime.updateSettings((settings) => {
231
- const { startHour: _start, endHour: _end, ...keep } = record(settings.cacheKeep);
232
- return {
233
- ...settings,
234
- cacheKeep: { ...keep, enabled: true, always: true },
235
- };
236
- });
222
+ await runtime.updateSettings(nativeCacheKeepAlways);
237
223
  return { ok: true, text: 'Native CacheKeep is always enabled.' };
238
224
  case 'cachekeep-off':
239
225
  await setSection('cacheKeep', { enabled: false });
@@ -345,3 +331,4 @@ export function createPiNativeCommands(storagePath = getPiAccountStoragePath())
345
331
  },
346
332
  };
347
333
  }
334
+ import { mergeNativeSettingsSection, nativeCacheKeepAlways, nativeSettingsRecord as record, } from '@cortexkit/anthropic-auth-core';
package/dist/native.d.ts CHANGED
@@ -33,6 +33,7 @@ export declare class PiNativeRuntime {
33
33
  private closed;
34
34
  private closing;
35
35
  readonly usagePublications: {
36
+ observe: (write: Promise<unknown>) => Promise<void>;
36
37
  publish(write: () => Promise<unknown>): void;
37
38
  drain(): Promise<void>;
38
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-anthropic-auth",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,11 +36,11 @@
36
36
  "prepublishOnly": "bun run build"
37
37
  },
38
38
  "dependencies": {
39
- "@cortexkit/anthropic-auth-core": "2.0.0"
39
+ "@cortexkit/anthropic-auth-core": "2.0.2"
40
40
  },
41
41
  "peerDependencies": {
42
- "@earendil-works/pi-ai": ">=0.86.1",
43
- "@earendil-works/pi-coding-agent": ">=0.86.1",
44
- "@earendil-works/pi-tui": ">=0.86.1"
42
+ "@earendil-works/pi-ai": ">=0.86.1 <2",
43
+ "@earendil-works/pi-coding-agent": ">=0.86.1 <2",
44
+ "@earendil-works/pi-tui": ">=0.86.1 <2"
45
45
  }
46
46
  }