@motebit/sdk 0.7.0 → 1.0.0
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/LICENSE +198 -18
- package/NOTICE +19 -0
- package/README.md +52 -5
- package/dist/appearance-config.d.ts +55 -0
- package/dist/appearance-config.d.ts.map +1 -0
- package/dist/appearance-config.js +79 -0
- package/dist/appearance-config.js.map +1 -0
- package/dist/credential-types-doc.d.ts +73 -0
- package/dist/credential-types-doc.d.ts.map +1 -0
- package/dist/credential-types-doc.js +2 -0
- package/dist/credential-types-doc.js.map +1 -0
- package/dist/governance-config.d.ts +5 -0
- package/dist/governance-config.d.ts.map +1 -1
- package/dist/governance-config.js +8 -1
- package/dist/governance-config.js.map +1 -1
- package/dist/index.d.ts +66 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +52 -14
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +59 -19
- package/dist/models.js.map +1 -1
- package/dist/provider-mode.d.ts +69 -0
- package/dist/provider-mode.d.ts.map +1 -0
- package/dist/provider-mode.js +60 -0
- package/dist/provider-mode.js.map +1 -0
- package/dist/provider-resolver.d.ts +179 -0
- package/dist/provider-resolver.d.ts.map +1 -0
- package/dist/provider-resolver.js +224 -0
- package/dist/provider-resolver.js.map +1 -0
- package/dist/risk-labels.d.ts +22 -0
- package/dist/risk-labels.d.ts.map +1 -0
- package/dist/risk-labels.js +28 -0
- package/dist/risk-labels.js.map +1 -0
- package/dist/surface-options.d.ts +34 -0
- package/dist/surface-options.d.ts.map +1 -0
- package/dist/surface-options.js +36 -0
- package/dist/surface-options.js.map +1 -0
- package/dist/voice-config.d.ts +52 -0
- package/dist/voice-config.d.ts.map +1 -0
- package/dist/voice-config.js +61 -0
- package/dist/voice-config.js.map +1 -0
- package/package.json +13 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export * from "@motebit/protocol";
|
|
2
|
-
export * from "./models";
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
2
|
+
export * from "./models.js";
|
|
3
|
+
export * from "./provider-mode.js";
|
|
4
|
+
export * from "./provider-resolver.js";
|
|
5
|
+
export * from "./color-presets.js";
|
|
6
|
+
export * from "./approval-presets.js";
|
|
7
|
+
export * from "./risk-labels.js";
|
|
8
|
+
export * from "./surface-options.js";
|
|
9
|
+
export * from "./governance-config.js";
|
|
10
|
+
export * from "./voice-config.js";
|
|
11
|
+
export * from "./appearance-config.js";
|
|
6
12
|
import type { SensitivityLevel, NodeId, MotebitId, TrustMode, BatteryMode, EventLogEntry, MemoryContent, MemoryCandidate, ToolDefinition, AgentTrustRecord, EventStoreAdapter, IdentityStorage, AuditLogAdapter, StateSnapshotAdapter, AuditLogSink, ConversationStoreAdapter, PlanStoreAdapter, AgentTrustStoreAdapter, ServiceListingStoreAdapter, BudgetAllocationStoreAdapter, SettlementStoreAdapter, LatencyStatsStoreAdapter, CredentialStoreAdapter, ApprovalStoreAdapter, MotebitIdentity, AuditRecord } from "@motebit/protocol";
|
|
7
13
|
export declare enum RelationType {
|
|
8
14
|
Related = "related",
|
|
@@ -132,6 +138,17 @@ export interface ContextPack {
|
|
|
132
138
|
firstConversation?: boolean;
|
|
133
139
|
/** System-triggered generation — appended to system prompt, no user message sent. */
|
|
134
140
|
activationPrompt?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Layer-1 memory index (spec/memory-delta-v1.md §5.8) — a compact
|
|
143
|
+
* always-loaded projection of the motebit's live memory graph as
|
|
144
|
+
* short-id + summary + certainty lines. Injected into the system
|
|
145
|
+
* prompt's dynamic suffix so the agent has a cheap overview of what
|
|
146
|
+
* it knows without round-tripping retrieval.
|
|
147
|
+
*
|
|
148
|
+
* Absent on iterations past the first (memory doesn't change
|
|
149
|
+
* mid-turn) and absent on surfaces that haven't opted in yet.
|
|
150
|
+
*/
|
|
151
|
+
memoryIndex?: string;
|
|
135
152
|
}
|
|
136
153
|
export type ConversationMessage = {
|
|
137
154
|
role: "user";
|
|
@@ -259,4 +276,49 @@ export interface StorageAdapters {
|
|
|
259
276
|
credentialStore?: CredentialStoreAdapter;
|
|
260
277
|
approvalStore?: ApprovalStoreAdapter;
|
|
261
278
|
}
|
|
279
|
+
/** Context passed to CredentialSource when requesting a credential. */
|
|
280
|
+
export interface CredentialRequest {
|
|
281
|
+
/** URL of the MCP server being called. */
|
|
282
|
+
serverUrl: string;
|
|
283
|
+
/** Tool name being invoked, if known at credential-acquisition time. */
|
|
284
|
+
toolName?: string;
|
|
285
|
+
/** Requested scope or audience for scoped credentials. */
|
|
286
|
+
scope?: string;
|
|
287
|
+
/** Motebit ID of the calling agent, if available. */
|
|
288
|
+
agentId?: string;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Adapter interface for obtaining credentials at tool-call time.
|
|
292
|
+
* Implementations may read from OS keyring, external vaults, or wrap static tokens.
|
|
293
|
+
*/
|
|
294
|
+
export interface CredentialSource {
|
|
295
|
+
getCredential(request: CredentialRequest): Promise<string | null>;
|
|
296
|
+
}
|
|
297
|
+
/** Config fields that server verifiers can update via VerificationResult. */
|
|
298
|
+
export interface VerifierConfigUpdates {
|
|
299
|
+
toolManifestHash?: string;
|
|
300
|
+
pinnedToolNames?: string[];
|
|
301
|
+
trusted?: boolean;
|
|
302
|
+
tlsCertFingerprint?: string;
|
|
303
|
+
}
|
|
304
|
+
/** Result of server verification. */
|
|
305
|
+
export interface VerificationResult {
|
|
306
|
+
ok: boolean;
|
|
307
|
+
error?: string;
|
|
308
|
+
configUpdates?: VerifierConfigUpdates;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Adapter interface for verifying an MCP server's integrity after connect.
|
|
312
|
+
* Fail-closed: ok:false or thrown errors should tear down the connection.
|
|
313
|
+
*/
|
|
314
|
+
export interface ServerVerifier {
|
|
315
|
+
verify(config: {
|
|
316
|
+
name: string;
|
|
317
|
+
url?: string;
|
|
318
|
+
toolManifestHash?: string;
|
|
319
|
+
pinnedToolNames?: string[];
|
|
320
|
+
trusted?: boolean;
|
|
321
|
+
tlsCertFingerprint?: string;
|
|
322
|
+
}, tools: ToolDefinition[]): Promise<VerificationResult>;
|
|
323
|
+
}
|
|
262
324
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AAEvC,OAAO,KAAK,EACV,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,SAAS,EACT,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAI3B,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,QAAQ,cAAc;IACtB,UAAU,gBAAgB;IAC1B,aAAa,mBAAmB;IAChC,UA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CAAC,kBAAkB,CAAC,CAAC;CAChC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export * from "@motebit/protocol";
|
|
2
|
-
export * from "./models";
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
2
|
+
export * from "./models.js";
|
|
3
|
+
export * from "./provider-mode.js";
|
|
4
|
+
export * from "./provider-resolver.js";
|
|
5
|
+
export * from "./color-presets.js";
|
|
6
|
+
export * from "./approval-presets.js";
|
|
7
|
+
export * from "./risk-labels.js";
|
|
8
|
+
export * from "./surface-options.js";
|
|
9
|
+
export * from "./governance-config.js";
|
|
10
|
+
export * from "./voice-config.js";
|
|
11
|
+
export * from "./appearance-config.js";
|
|
6
12
|
// === Relation Types (product — graph semantics for memory edges) ===
|
|
7
13
|
export var RelationType;
|
|
8
14
|
(function (RelationType) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AA+BvC,sEAAsE;AAEtE,MAAM,CAAN,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,sCAAsB,CAAA;IACtB,0CAA0B,CAAA;IAC1B,gDAAgC,CAAA;IAChC,yCAAyB,CAAA;IACzB,kCAAkB,CAAA;IAClB,yCAAyB,CAAA;AAC3B,CAAC,EARW,YAAY,KAAZ,YAAY,QAQvB;AA2BD,uFAAuF;AAEvF,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,mBAAmB,EAAE,GAAG;CAChB,CAAC,CAAC"}
|
package/dist/models.d.ts
CHANGED
|
@@ -1,26 +1,64 @@
|
|
|
1
|
-
/** Anthropic Claude models
|
|
2
|
-
export declare const ANTHROPIC_MODELS: readonly ["claude-
|
|
3
|
-
/** OpenAI models
|
|
4
|
-
export declare const OPENAI_MODELS: readonly ["gpt-
|
|
5
|
-
/** Google models
|
|
6
|
-
export declare const GOOGLE_MODELS: readonly ["gemini-2.5-pro", "gemini-2.5-flash"];
|
|
7
|
-
/**
|
|
1
|
+
/** Anthropic Claude models: opus (strongest), sonnet (default), haiku (fast). */
|
|
2
|
+
export declare const ANTHROPIC_MODELS: readonly ["claude-opus-4-6", "claude-sonnet-4-6", "claude-haiku-4-5-20251001"];
|
|
3
|
+
/** OpenAI models: gpt-5.4 (strongest), gpt-5.4-mini (default), gpt-5.4-nano (fast). */
|
|
4
|
+
export declare const OPENAI_MODELS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
|
|
5
|
+
/** Google models: 2.5 pro (strongest), 2.5 flash (default), 2.5 flash-lite (fast). */
|
|
6
|
+
export declare const GOOGLE_MODELS: readonly ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
|
|
7
|
+
/**
|
|
8
|
+
* Common open-weights models that any local inference server can run.
|
|
9
|
+
*
|
|
10
|
+
* These identifiers are the model FAMILIES supported by every major local
|
|
11
|
+
* inference server (Ollama, LM Studio, llama.cpp, Jan, vLLM). The names are
|
|
12
|
+
* not Ollama-specific — Llama is Meta's, Mistral is Mistral AI's, Gemma is
|
|
13
|
+
* Google's, Phi is Microsoft's, Qwen is Alibaba's, Codellama is Meta's. Each
|
|
14
|
+
* server pulls them from its own catalog (Ollama from its registry, LM Studio
|
|
15
|
+
* from HuggingFace, llama.cpp from GGUF files, etc.).
|
|
16
|
+
*
|
|
17
|
+
* Use this as the dropdown source for "what model do you want to run" in
|
|
18
|
+
* any on-device / local-server UI. The user can pull any model; these are
|
|
19
|
+
* the safe defaults to surface first.
|
|
20
|
+
*/
|
|
21
|
+
export declare const LOCAL_SERVER_SUGGESTED_MODELS: readonly ["llama3.2", "llama3.1", "llama3", "mistral", "codellama", "gemma2", "phi3", "qwen2"];
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated since 1.0.0, removed in 2.0.0. Use {@link LOCAL_SERVER_SUGGESTED_MODELS} instead.
|
|
24
|
+
*
|
|
25
|
+
* Reason: the old name implied the list was Ollama-specific, but every
|
|
26
|
+
* entry runs on every supported local inference server (Ollama, LM Studio,
|
|
27
|
+
* llama.cpp, vLLM). Vendor-neutral naming matches the runtime's
|
|
28
|
+
* `"local-server"` provider discriminator.
|
|
29
|
+
*/
|
|
8
30
|
export declare const OLLAMA_SUGGESTED_MODELS: readonly ["llama3.2", "llama3.1", "llama3", "mistral", "codellama", "gemma2", "phi3", "qwen2"];
|
|
9
31
|
/** Models available through the Motebit proxy (all cloud providers). */
|
|
10
|
-
export declare const PROXY_MODELS: readonly ["claude-
|
|
32
|
+
export declare const PROXY_MODELS: readonly ["claude-opus-4-6", "claude-sonnet-4-6", "claude-haiku-4-5-20251001", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
|
|
11
33
|
/** Default Anthropic model. */
|
|
12
|
-
export declare const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-
|
|
34
|
+
export declare const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-6";
|
|
13
35
|
/** Default OpenAI model. */
|
|
14
|
-
export declare const DEFAULT_OPENAI_MODEL = "gpt-
|
|
36
|
+
export declare const DEFAULT_OPENAI_MODEL = "gpt-5.4-mini";
|
|
15
37
|
/** Default Google model. */
|
|
16
|
-
export declare const DEFAULT_GOOGLE_MODEL = "gemini-2.5-
|
|
17
|
-
/** Default Ollama model. */
|
|
38
|
+
export declare const DEFAULT_GOOGLE_MODEL = "gemini-2.5-flash";
|
|
39
|
+
/** Default Ollama model — used as the `local-server` default too. */
|
|
18
40
|
export declare const DEFAULT_OLLAMA_MODEL = "llama3.2";
|
|
41
|
+
/**
|
|
42
|
+
* Canonical default model for the on-device `local-server` backend.
|
|
43
|
+
* Currently aliased to `DEFAULT_OLLAMA_MODEL` — Ollama's `llama3.2` is
|
|
44
|
+
* the sensible first-run default even for users who end up running
|
|
45
|
+
* LM Studio / llama.cpp / vLLM. Prefer this name in new code; the
|
|
46
|
+
* Ollama-specific alias is retained for places that genuinely mean
|
|
47
|
+
* the Ollama model identifier.
|
|
48
|
+
*/
|
|
49
|
+
export declare const DEFAULT_LOCAL_SERVER_MODEL = "llama3.2";
|
|
19
50
|
/** Default proxy model (used when no model is specified). */
|
|
20
|
-
export declare const DEFAULT_PROXY_MODEL = "claude-sonnet-4-
|
|
51
|
+
export declare const DEFAULT_PROXY_MODEL = "claude-sonnet-4-6";
|
|
21
52
|
export type AnthropicModel = (typeof ANTHROPIC_MODELS)[number];
|
|
22
53
|
export type OpenAIModel = (typeof OPENAI_MODELS)[number];
|
|
23
54
|
export type GoogleModel = (typeof GOOGLE_MODELS)[number];
|
|
24
|
-
export type
|
|
55
|
+
export type LocalServerSuggestedModel = (typeof LOCAL_SERVER_SUGGESTED_MODELS)[number];
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated since 1.0.0, removed in 2.0.0. Use {@link LocalServerSuggestedModel} instead.
|
|
58
|
+
*
|
|
59
|
+
* Reason: paired with {@link OLLAMA_SUGGESTED_MODELS}. Vendor-neutral
|
|
60
|
+
* naming for the same underlying model set.
|
|
61
|
+
*/
|
|
62
|
+
export type OllamaSuggestedModel = LocalServerSuggestedModel;
|
|
25
63
|
export type ProxyModel = (typeof PROXY_MODELS)[number];
|
|
26
64
|
//# sourceMappingURL=models.d.ts.map
|
package/dist/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AASA,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,gFAInB,CAAC;AAEX,uFAAuF;AACvF,eAAO,MAAM,aAAa,sDAAuD,CAAC;AAElF,sFAAsF;AACtF,eAAO,MAAM,aAAa,0EAIhB,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,gGAShC,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,gGAAgC,CAAC;AAErE,wEAAwE;AACxE,eAAO,MAAM,YAAY,0LAUf,CAAC;AAIX,+BAA+B;AAC/B,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D,4BAA4B;AAC5B,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,4BAA4B;AAC5B,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,aAAuB,CAAC;AAE/D,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAIvD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACzD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACzD,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AACvF;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAC7D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/models.js
CHANGED
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
// === AI Model Constants ===
|
|
2
2
|
//
|
|
3
3
|
// Single source of truth for model identifiers across all surfaces.
|
|
4
|
-
// SDK is Layer 0 (
|
|
4
|
+
// SDK is Layer 0 (Apache-2.0 permissive floor, no deps beyond protocol) — only string constants here.
|
|
5
5
|
// Pricing, routing, and alias resolution live in their respective packages.
|
|
6
|
-
|
|
6
|
+
//
|
|
7
|
+
// 3 tiers per provider: strongest, default, fast.
|
|
8
|
+
// When a new model ships, update the arrays — every surface picks it up.
|
|
9
|
+
/** Anthropic Claude models: opus (strongest), sonnet (default), haiku (fast). */
|
|
7
10
|
export const ANTHROPIC_MODELS = [
|
|
8
|
-
"claude-
|
|
11
|
+
"claude-opus-4-6",
|
|
12
|
+
"claude-sonnet-4-6",
|
|
9
13
|
"claude-haiku-4-5-20251001",
|
|
10
|
-
"claude-opus-4-20250115",
|
|
11
14
|
];
|
|
12
|
-
/** OpenAI models
|
|
13
|
-
export const OPENAI_MODELS = ["gpt-
|
|
14
|
-
/** Google models
|
|
15
|
-
export const GOOGLE_MODELS = [
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/** OpenAI models: gpt-5.4 (strongest), gpt-5.4-mini (default), gpt-5.4-nano (fast). */
|
|
16
|
+
export const OPENAI_MODELS = ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
|
|
17
|
+
/** Google models: 2.5 pro (strongest), 2.5 flash (default), 2.5 flash-lite (fast). */
|
|
18
|
+
export const GOOGLE_MODELS = [
|
|
19
|
+
"gemini-2.5-pro",
|
|
20
|
+
"gemini-2.5-flash",
|
|
21
|
+
"gemini-2.5-flash-lite",
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Common open-weights models that any local inference server can run.
|
|
25
|
+
*
|
|
26
|
+
* These identifiers are the model FAMILIES supported by every major local
|
|
27
|
+
* inference server (Ollama, LM Studio, llama.cpp, Jan, vLLM). The names are
|
|
28
|
+
* not Ollama-specific — Llama is Meta's, Mistral is Mistral AI's, Gemma is
|
|
29
|
+
* Google's, Phi is Microsoft's, Qwen is Alibaba's, Codellama is Meta's. Each
|
|
30
|
+
* server pulls them from its own catalog (Ollama from its registry, LM Studio
|
|
31
|
+
* from HuggingFace, llama.cpp from GGUF files, etc.).
|
|
32
|
+
*
|
|
33
|
+
* Use this as the dropdown source for "what model do you want to run" in
|
|
34
|
+
* any on-device / local-server UI. The user can pull any model; these are
|
|
35
|
+
* the safe defaults to surface first.
|
|
36
|
+
*/
|
|
37
|
+
export const LOCAL_SERVER_SUGGESTED_MODELS = [
|
|
18
38
|
"llama3.2",
|
|
19
39
|
"llama3.1",
|
|
20
40
|
"llama3",
|
|
@@ -24,25 +44,45 @@ export const OLLAMA_SUGGESTED_MODELS = [
|
|
|
24
44
|
"phi3",
|
|
25
45
|
"qwen2",
|
|
26
46
|
];
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated since 1.0.0, removed in 2.0.0. Use {@link LOCAL_SERVER_SUGGESTED_MODELS} instead.
|
|
49
|
+
*
|
|
50
|
+
* Reason: the old name implied the list was Ollama-specific, but every
|
|
51
|
+
* entry runs on every supported local inference server (Ollama, LM Studio,
|
|
52
|
+
* llama.cpp, vLLM). Vendor-neutral naming matches the runtime's
|
|
53
|
+
* `"local-server"` provider discriminator.
|
|
54
|
+
*/
|
|
55
|
+
export const OLLAMA_SUGGESTED_MODELS = LOCAL_SERVER_SUGGESTED_MODELS;
|
|
27
56
|
/** Models available through the Motebit proxy (all cloud providers). */
|
|
28
57
|
export const PROXY_MODELS = [
|
|
29
|
-
"claude-
|
|
30
|
-
"claude-
|
|
58
|
+
"claude-opus-4-6",
|
|
59
|
+
"claude-sonnet-4-6",
|
|
31
60
|
"claude-haiku-4-5-20251001",
|
|
32
|
-
"gpt-
|
|
33
|
-
"gpt-
|
|
61
|
+
"gpt-5.4",
|
|
62
|
+
"gpt-5.4-mini",
|
|
63
|
+
"gpt-5.4-nano",
|
|
34
64
|
"gemini-2.5-pro",
|
|
35
65
|
"gemini-2.5-flash",
|
|
66
|
+
"gemini-2.5-flash-lite",
|
|
36
67
|
];
|
|
37
68
|
// === Default Models ===
|
|
38
69
|
/** Default Anthropic model. */
|
|
39
|
-
export const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-
|
|
70
|
+
export const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-6";
|
|
40
71
|
/** Default OpenAI model. */
|
|
41
|
-
export const DEFAULT_OPENAI_MODEL = "gpt-
|
|
72
|
+
export const DEFAULT_OPENAI_MODEL = "gpt-5.4-mini";
|
|
42
73
|
/** Default Google model. */
|
|
43
|
-
export const DEFAULT_GOOGLE_MODEL = "gemini-2.5-
|
|
44
|
-
/** Default Ollama model. */
|
|
74
|
+
export const DEFAULT_GOOGLE_MODEL = "gemini-2.5-flash";
|
|
75
|
+
/** Default Ollama model — used as the `local-server` default too. */
|
|
45
76
|
export const DEFAULT_OLLAMA_MODEL = "llama3.2";
|
|
77
|
+
/**
|
|
78
|
+
* Canonical default model for the on-device `local-server` backend.
|
|
79
|
+
* Currently aliased to `DEFAULT_OLLAMA_MODEL` — Ollama's `llama3.2` is
|
|
80
|
+
* the sensible first-run default even for users who end up running
|
|
81
|
+
* LM Studio / llama.cpp / vLLM. Prefer this name in new code; the
|
|
82
|
+
* Ollama-specific alias is retained for places that genuinely mean
|
|
83
|
+
* the Ollama model identifier.
|
|
84
|
+
*/
|
|
85
|
+
export const DEFAULT_LOCAL_SERVER_MODEL = DEFAULT_OLLAMA_MODEL;
|
|
46
86
|
/** Default proxy model (used when no model is specified). */
|
|
47
|
-
export const DEFAULT_PROXY_MODEL = "claude-sonnet-4-
|
|
87
|
+
export const DEFAULT_PROXY_MODEL = "claude-sonnet-4-6";
|
|
48
88
|
//# sourceMappingURL=models.js.map
|
package/dist/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,EAAE;AACF,oEAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,EAAE;AACF,oEAAoE;AACpE,sGAAsG;AACtG,4EAA4E;AAC5E,EAAE;AACF,kDAAkD;AAClD,yEAAyE;AAEzE,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,mBAAmB;IACnB,2BAA2B;CACnB,CAAC;AAEX,uFAAuF;AACvF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAU,CAAC;AAElF,sFAAsF;AACtF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,gBAAgB;IAChB,kBAAkB;IAClB,uBAAuB;CACf,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,UAAU;IACV,UAAU;IACV,QAAQ;IACR,SAAS;IACT,WAAW;IACX,QAAQ;IACR,MAAM;IACN,OAAO;CACC,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;AAErE,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,iBAAiB;IACjB,mBAAmB;IACnB,2BAA2B;IAC3B,SAAS;IACT,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,uBAAuB;CACf,CAAC;AAEX,yBAAyB;AAEzB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE3D,4BAA4B;AAC5B,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAEnD,4BAA4B;AAC5B,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAE/D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Top-level provider mode — the user's intent, not the concrete vendor.
|
|
3
|
+
*
|
|
4
|
+
* - `on-device`: the user wants inference to run locally (privacy, offline, latency).
|
|
5
|
+
* - `motebit-cloud`: the user wants the default product experience (subscription, auto-routing).
|
|
6
|
+
* - `byok`: the user brings their own API key to a named vendor.
|
|
7
|
+
*/
|
|
8
|
+
export type ProviderMode = "on-device" | "motebit-cloud" | "byok";
|
|
9
|
+
/**
|
|
10
|
+
* On-device backend kinds. Not every backend is available on every platform:
|
|
11
|
+
*
|
|
12
|
+
* - `apple-fm`: Apple Foundation Models (iOS/macOS 26+ only).
|
|
13
|
+
* - `mlx`: MLX runtime (Apple Silicon, iOS 16+ / macOS).
|
|
14
|
+
* - `webllm`: MLC WebLLM in-browser (web surface + WebGPU only).
|
|
15
|
+
* - `local-server`: auto-detected local OpenAI-compatible server
|
|
16
|
+
* (Ollama, LM Studio, llama.cpp, Jan, vLLM, …). Vendor-agnostic.
|
|
17
|
+
*/
|
|
18
|
+
export type OnDeviceBackend = "apple-fm" | "mlx" | "webllm" | "local-server";
|
|
19
|
+
/** BYOK vendors — the only ones where the user holds the API key directly. */
|
|
20
|
+
export type ByokVendor = "anthropic" | "openai" | "google";
|
|
21
|
+
/** On-device mode config. */
|
|
22
|
+
export interface OnDeviceProviderConfig {
|
|
23
|
+
mode: "on-device";
|
|
24
|
+
backend: OnDeviceBackend;
|
|
25
|
+
/** Model identifier. Meaning depends on backend (MLX name, WebLLM id, server tag, …). */
|
|
26
|
+
model?: string;
|
|
27
|
+
/** For `local-server`: endpoint URL (e.g., http://localhost:11434). Auto-detected otherwise. */
|
|
28
|
+
endpoint?: string;
|
|
29
|
+
/** Optional temperature override. */
|
|
30
|
+
temperature?: number;
|
|
31
|
+
/** Optional max_tokens override. */
|
|
32
|
+
maxTokens?: number;
|
|
33
|
+
}
|
|
34
|
+
/** Motebit Cloud mode config — the subscription-backed product. */
|
|
35
|
+
export interface MotebitCloudProviderConfig {
|
|
36
|
+
mode: "motebit-cloud";
|
|
37
|
+
/** Optional preferred model. When omitted, the relay picks. */
|
|
38
|
+
model?: string;
|
|
39
|
+
/** Signed proxy token — included as x-proxy-token for authenticated requests. */
|
|
40
|
+
proxyToken?: string;
|
|
41
|
+
/** Override proxy base URL (dev/staging). */
|
|
42
|
+
baseUrl?: string;
|
|
43
|
+
temperature?: number;
|
|
44
|
+
maxTokens?: number;
|
|
45
|
+
}
|
|
46
|
+
/** BYOK mode config — user supplies the API key. */
|
|
47
|
+
export interface ByokProviderConfig {
|
|
48
|
+
mode: "byok";
|
|
49
|
+
vendor: ByokVendor;
|
|
50
|
+
apiKey: string;
|
|
51
|
+
model?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Optional custom base URL. Used e.g. for Google via the OpenAI-compatible
|
|
54
|
+
* endpoint (`https://generativelanguage.googleapis.com/v1beta/openai`).
|
|
55
|
+
*/
|
|
56
|
+
baseUrl?: string;
|
|
57
|
+
temperature?: number;
|
|
58
|
+
maxTokens?: number;
|
|
59
|
+
}
|
|
60
|
+
/** Union of all three modes. Surfaces persist this shape. */
|
|
61
|
+
export type UnifiedProviderConfig = OnDeviceProviderConfig | MotebitCloudProviderConfig | ByokProviderConfig;
|
|
62
|
+
/**
|
|
63
|
+
* Heuristic: is this URL pointing at a local inference server?
|
|
64
|
+
* Shared across all surfaces so the migration behaves identically everywhere.
|
|
65
|
+
*/
|
|
66
|
+
export declare function isLocalServerUrl(url: string | undefined | null): boolean;
|
|
67
|
+
/** Sensible default when no config has ever been persisted. */
|
|
68
|
+
export declare function defaultProviderConfig(): MotebitCloudProviderConfig;
|
|
69
|
+
//# sourceMappingURL=provider-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-mode.d.ts","sourceRoot":"","sources":["../src/provider-mode.ts"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,eAAe,GAAG,MAAM,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,cAAc,CAAC;AAE7E,8EAA8E;AAC9E,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D,6BAA6B;AAC7B,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,eAAe,CAAC;IACzB,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mEAAmE;AACnE,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,eAAe,CAAC;IACtB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6DAA6D;AAC7D,MAAM,MAAM,qBAAqB,GAC7B,sBAAsB,GACtB,0BAA0B,GAC1B,kBAAkB,CAAC;AAuBvB;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAkBxE;AAID,+DAA+D;AAC/D,wBAAgB,qBAAqB,IAAI,0BAA0B,CAElE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// === Provider Mode (Three-Mode Architecture) ===
|
|
2
|
+
//
|
|
3
|
+
// User-intent-based provider config — matches the pattern of settlement rails:
|
|
4
|
+
// user picks the capability class, the system resolves the concrete vendor.
|
|
5
|
+
//
|
|
6
|
+
// Flat unions like "ollama" | "anthropic" | "openai" | "hybrid" mix implementation
|
|
7
|
+
// details with user intent. "Hybrid" is an implementation detail, not a user choice.
|
|
8
|
+
// "Ollama" is a vendor name, not a capability class.
|
|
9
|
+
//
|
|
10
|
+
// All surfaces (web, mobile, desktop, cli) persist and exchange this shape.
|
|
11
|
+
// Platform-specific sub-options live inside each mode's discriminated variant.
|
|
12
|
+
// === Migration ===
|
|
13
|
+
//
|
|
14
|
+
// Legacy shapes, in order of historical appearance:
|
|
15
|
+
//
|
|
16
|
+
// Web (apps/web/src/storage.ts):
|
|
17
|
+
// { type: "anthropic" | "openai" | "ollama" | "webllm" | "proxy",
|
|
18
|
+
// apiKey?, model, baseUrl?, proxyToken?, maxTokens?, temperature? }
|
|
19
|
+
//
|
|
20
|
+
// Mobile (apps/mobile/src/mobile-app.ts):
|
|
21
|
+
// { provider: "ollama" | "anthropic" | "openai" | "hybrid" | "proxy" | "local",
|
|
22
|
+
// localBackend?: "apple-fm" | "mlx",
|
|
23
|
+
// model?, apiKey?, ollamaEndpoint?, maxTokens? }
|
|
24
|
+
//
|
|
25
|
+
// Desktop (apps/desktop/src/index.ts):
|
|
26
|
+
// { provider: "anthropic" | "ollama" | "openai" | "proxy" | "hybrid",
|
|
27
|
+
// model?, apiKey?, maxTokens? }
|
|
28
|
+
//
|
|
29
|
+
// CLI (apps/cli/src/config.ts):
|
|
30
|
+
// { default_provider?: "anthropic" | "openai" | "ollama",
|
|
31
|
+
// default_model?, api_key? (in keyring) }
|
|
32
|
+
/**
|
|
33
|
+
* Heuristic: is this URL pointing at a local inference server?
|
|
34
|
+
* Shared across all surfaces so the migration behaves identically everywhere.
|
|
35
|
+
*/
|
|
36
|
+
export function isLocalServerUrl(url) {
|
|
37
|
+
if (!url)
|
|
38
|
+
return false;
|
|
39
|
+
try {
|
|
40
|
+
const u = new URL(url);
|
|
41
|
+
const host = u.hostname.toLowerCase();
|
|
42
|
+
return (host === "localhost" ||
|
|
43
|
+
host === "127.0.0.1" ||
|
|
44
|
+
host === "::1" ||
|
|
45
|
+
host === "0.0.0.0" ||
|
|
46
|
+
host.endsWith(".local") ||
|
|
47
|
+
/^10\./.test(host) ||
|
|
48
|
+
/^192\.168\./.test(host) ||
|
|
49
|
+
/^172\.(1[6-9]|2\d|3[01])\./.test(host));
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// === Defaults ===
|
|
56
|
+
/** Sensible default when no config has ever been persisted. */
|
|
57
|
+
export function defaultProviderConfig() {
|
|
58
|
+
return { mode: "motebit-cloud" };
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=provider-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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