@cortexkit/pi-anthropic-auth 2.0.0 → 2.0.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/dist/native-commands.js +3 -16
- package/dist/native.d.ts +1 -0
- package/package.json +2 -2
package/dist/native-commands.js
CHANGED
|
@@ -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(
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/pi-anthropic-auth",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"prepublishOnly": "bun run build"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@cortexkit/anthropic-auth-core": "2.0.
|
|
39
|
+
"@cortexkit/anthropic-auth-core": "2.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@earendil-works/pi-ai": ">=0.86.1",
|