@inkdropapp/ai 0.1.5 → 0.1.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkdropapp/ai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "AI integration common module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -11,15 +11,26 @@
|
|
|
11
11
|
"default": "./src/index.ts"
|
|
12
12
|
},
|
|
13
13
|
"./constants": {
|
|
14
|
-
"types": "./types/
|
|
15
|
-
"default": "./src/
|
|
14
|
+
"types": "./types/constants.d.ts",
|
|
15
|
+
"default": "./src/constants.ts"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"ai",
|
|
20
20
|
"inkdrop"
|
|
21
21
|
],
|
|
22
|
-
"author":
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "Takuya Matsuyama",
|
|
24
|
+
"email": "t@inkdrop.app"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/inkdropapp/ai#readme",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/inkdropapp/ai.git"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/inkdropapp/ai/issues"
|
|
33
|
+
},
|
|
23
34
|
"license": "UNLICENSED",
|
|
24
35
|
"dependencies": {
|
|
25
36
|
"@ai-sdk/anthropic": "4.0.0-beta.42",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure-data
|
|
2
|
+
* Pure-data constants for settings UIs.
|
|
3
3
|
*
|
|
4
4
|
* This module has no class or native-module imports, so it's safe to load in
|
|
5
5
|
* an Electron renderer process — unlike the main package entrypoint, which
|
|
@@ -14,10 +14,14 @@
|
|
|
14
14
|
* ANTHROPIC_DEFAULT_BASE_URL,
|
|
15
15
|
* OPENAI_COMPATIBLE_PROVIDER_ID,
|
|
16
16
|
* OPENAI_COMPATIBLE_PROVIDER_NAME,
|
|
17
|
-
* deriveEnvVarName
|
|
17
|
+
* deriveEnvVarName,
|
|
18
|
+
* SLOT_DEFAULT,
|
|
19
|
+
* SLOT_FAST
|
|
18
20
|
* } from '@inkdropapp/ai/constants'
|
|
19
21
|
*/
|
|
20
22
|
|
|
23
|
+
import type { SlotName } from './settings.js'
|
|
24
|
+
|
|
21
25
|
export {
|
|
22
26
|
ANTHROPIC_PROVIDER_ID,
|
|
23
27
|
ANTHROPIC_PROVIDER_NAME,
|
|
@@ -29,3 +33,11 @@ export {
|
|
|
29
33
|
OPENAI_COMPATIBLE_PROVIDER_NAME,
|
|
30
34
|
deriveEnvVarName
|
|
31
35
|
} from './providers/openai-compatible/constants.js'
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* String literals for the two task slots exposed by {@link SlotName}.
|
|
39
|
+
* `satisfies SlotName` preserves the narrow literal type while verifying at
|
|
40
|
+
* compile time that the value is a valid `SlotName`.
|
|
41
|
+
*/
|
|
42
|
+
export const SLOT_DEFAULT = 'default' satisfies SlotName
|
|
43
|
+
export const SLOT_FAST = 'fast' satisfies SlotName
|
package/src/index.ts
CHANGED
|
@@ -54,8 +54,10 @@ export {
|
|
|
54
54
|
ANTHROPIC_DEFAULT_BASE_URL,
|
|
55
55
|
OPENAI_COMPATIBLE_PROVIDER_ID,
|
|
56
56
|
OPENAI_COMPATIBLE_PROVIDER_NAME,
|
|
57
|
-
deriveEnvVarName
|
|
58
|
-
|
|
57
|
+
deriveEnvVarName,
|
|
58
|
+
SLOT_DEFAULT,
|
|
59
|
+
SLOT_FAST
|
|
60
|
+
} from './constants.js'
|
|
59
61
|
export { AnthropicProvider } from './providers/anthropic/provider.js'
|
|
60
62
|
export { OpenAICompatibleProvider } from './providers/openai-compatible/provider.js'
|
|
61
63
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export const ANTHROPIC_PROVIDER_ID = 'anthropic'
|
|
2
2
|
export const ANTHROPIC_PROVIDER_NAME = 'Anthropic'
|
|
3
3
|
export const ANTHROPIC_ENV_VAR = 'ANTHROPIC_API_KEY'
|
|
4
|
-
export const ANTHROPIC_DEFAULT_BASE_URL = 'https://api.anthropic.com'
|
|
4
|
+
export const ANTHROPIC_DEFAULT_BASE_URL = 'https://api.anthropic.com/v1'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure-data constants for settings UIs.
|
|
3
|
+
*
|
|
4
|
+
* This module has no class or native-module imports, so it's safe to load in
|
|
5
|
+
* an Electron renderer process — unlike the main package entrypoint, which
|
|
6
|
+
* transitively pulls in `@napi-rs/keyring`.
|
|
7
|
+
*
|
|
8
|
+
* Consume via the `@inkdropapp/ai/constants` subpath:
|
|
9
|
+
*
|
|
10
|
+
* import {
|
|
11
|
+
* ANTHROPIC_PROVIDER_ID,
|
|
12
|
+
* ANTHROPIC_PROVIDER_NAME,
|
|
13
|
+
* ANTHROPIC_ENV_VAR,
|
|
14
|
+
* ANTHROPIC_DEFAULT_BASE_URL,
|
|
15
|
+
* OPENAI_COMPATIBLE_PROVIDER_ID,
|
|
16
|
+
* OPENAI_COMPATIBLE_PROVIDER_NAME,
|
|
17
|
+
* deriveEnvVarName,
|
|
18
|
+
* SLOT_DEFAULT,
|
|
19
|
+
* SLOT_FAST
|
|
20
|
+
* } from '@inkdropapp/ai/constants'
|
|
21
|
+
*/
|
|
22
|
+
export { ANTHROPIC_PROVIDER_ID, ANTHROPIC_PROVIDER_NAME, ANTHROPIC_ENV_VAR, ANTHROPIC_DEFAULT_BASE_URL } from './providers/anthropic/constants.js';
|
|
23
|
+
export { OPENAI_COMPATIBLE_PROVIDER_ID, OPENAI_COMPATIBLE_PROVIDER_NAME, deriveEnvVarName } from './providers/openai-compatible/constants.js';
|
|
24
|
+
/**
|
|
25
|
+
* String literals for the two task slots exposed by {@link SlotName}.
|
|
26
|
+
* `satisfies SlotName` preserves the narrow literal type while verifying at
|
|
27
|
+
* compile time that the value is a valid `SlotName`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SLOT_DEFAULT = "default";
|
|
30
|
+
export declare const SLOT_FAST = "fast";
|
package/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { ANTHROPIC_MODELS, ANTHROPIC_DEFAULT_MODEL_ID, ANTHROPIC_DEFAULT_FAST_MO
|
|
|
5
5
|
export { AIError, NoApiKey, AuthenticationError, RateLimitExceeded, ServerOverloaded, PromptTooLarge, UpstreamError, isAIError, type AIErrorKind } from './errors.js';
|
|
6
6
|
export { KeyStore, type KeyStoreOptions } from './key-store.js';
|
|
7
7
|
export { normalizeBaseURL } from './url.js';
|
|
8
|
-
export { ANTHROPIC_PROVIDER_ID, ANTHROPIC_PROVIDER_NAME, ANTHROPIC_ENV_VAR, ANTHROPIC_DEFAULT_BASE_URL, OPENAI_COMPATIBLE_PROVIDER_ID, OPENAI_COMPATIBLE_PROVIDER_NAME, deriveEnvVarName } from './
|
|
8
|
+
export { ANTHROPIC_PROVIDER_ID, ANTHROPIC_PROVIDER_NAME, ANTHROPIC_ENV_VAR, ANTHROPIC_DEFAULT_BASE_URL, OPENAI_COMPATIBLE_PROVIDER_ID, OPENAI_COMPATIBLE_PROVIDER_NAME, deriveEnvVarName, SLOT_DEFAULT, SLOT_FAST } from './constants.js';
|
|
9
9
|
export { AnthropicProvider } from './providers/anthropic/provider.js';
|
|
10
10
|
export { OpenAICompatibleProvider } from './providers/openai-compatible/provider.js';
|
|
11
11
|
export { AIRegistry, type AIRegistryOptions, type ResolvedSlot } from './registry.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const ANTHROPIC_PROVIDER_ID = "anthropic";
|
|
2
2
|
export declare const ANTHROPIC_PROVIDER_NAME = "Anthropic";
|
|
3
3
|
export declare const ANTHROPIC_ENV_VAR = "ANTHROPIC_API_KEY";
|
|
4
|
-
export declare const ANTHROPIC_DEFAULT_BASE_URL = "https://api.anthropic.com";
|
|
4
|
+
export declare const ANTHROPIC_DEFAULT_BASE_URL = "https://api.anthropic.com/v1";
|