@motebit/sdk 1.0.1 → 1.2.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/dist/index.d.ts +155 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +49 -2
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +49 -2
- package/dist/models.js.map +1 -1
- package/dist/pixel-consent.d.ts +32 -0
- package/dist/pixel-consent.d.ts.map +1 -0
- package/dist/pixel-consent.js +38 -0
- package/dist/pixel-consent.js.map +1 -0
- package/dist/provider-mode.d.ts +22 -2
- package/dist/provider-mode.d.ts.map +1 -1
- package/dist/provider-mode.js.map +1 -1
- package/dist/provider-resolver.d.ts +18 -0
- package/dist/provider-resolver.d.ts.map +1 -1
- package/dist/provider-resolver.js +32 -4
- package/dist/provider-resolver.js.map +1 -1
- package/dist/session-state.d.ts +83 -0
- package/dist/session-state.d.ts.map +1 -0
- package/dist/session-state.js +23 -0
- package/dist/session-state.js.map +1 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,10 @@ export * from "./surface-options.js";
|
|
|
9
9
|
export * from "./governance-config.js";
|
|
10
10
|
export * from "./voice-config.js";
|
|
11
11
|
export * from "./appearance-config.js";
|
|
12
|
+
export * from "./pixel-consent.js";
|
|
13
|
+
export * from "./session-state.js";
|
|
12
14
|
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";
|
|
15
|
+
import type { SessionStateSnapshot } from "./session-state.js";
|
|
13
16
|
export declare enum RelationType {
|
|
14
17
|
Related = "related",
|
|
15
18
|
CausedBy = "caused_by",
|
|
@@ -81,6 +84,22 @@ export interface MemoryStorageAdapter {
|
|
|
81
84
|
tombstoneNode(nodeId: string): Promise<void>;
|
|
82
85
|
/** Tombstone with ownership check. Returns true if the node existed and belonged to motebitId. */
|
|
83
86
|
tombstoneNodeOwned?(nodeId: string, motebitId: string): Promise<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* Erase a node — physically remove the row and any edges referencing it.
|
|
89
|
+
* Required by the `mutable_pruning` retention contract per
|
|
90
|
+
* docs/doctrine/retention-policy.md §"Decision 7": certificates of
|
|
91
|
+
* kind `mutable_pruning` attest that the bytes are unrecoverable, so
|
|
92
|
+
* a tombstoned-but-stored node would silently weaken the cert's
|
|
93
|
+
* claim. Distinct from `tombstoneNode`, which keeps the row with a
|
|
94
|
+
* `tombstoned: true` flag for soft-delete lifecycle (decay /
|
|
95
|
+
* notability passes that don't issue a deletion cert).
|
|
96
|
+
*
|
|
97
|
+
* Implementations MUST remove the node row and every edge whose
|
|
98
|
+
* `source_id` or `target_id` references the erased node. After
|
|
99
|
+
* `eraseNode(id)` resolves, `getNode(id)` returns `null` and
|
|
100
|
+
* `getEdges(id)` returns `[]`.
|
|
101
|
+
*/
|
|
102
|
+
eraseNode(nodeId: string): Promise<void>;
|
|
84
103
|
pinNode(nodeId: string, pinned: boolean): Promise<void>;
|
|
85
104
|
getAllNodes(motebitId: string): Promise<MemoryNode[]>;
|
|
86
105
|
getAllEdges(motebitId: string): Promise<MemoryEdge[]>;
|
|
@@ -149,18 +168,115 @@ export interface ContextPack {
|
|
|
149
168
|
* mid-turn) and absent on surfaces that haven't opted in yet.
|
|
150
169
|
*/
|
|
151
170
|
memoryIndex?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Skills selected by the runtime's `SkillSelectorHook` for this turn
|
|
173
|
+
* (spec/skills-v1.md §7). Absent when no hook is wired or no skill
|
|
174
|
+
* passed every gate (provenance + platform + sensitivity + HA + relevance).
|
|
175
|
+
* First iteration only — same pattern as `memoryIndex` and
|
|
176
|
+
* `curiosityHints`.
|
|
177
|
+
*/
|
|
178
|
+
selectedSkills?: SkillInjection[];
|
|
179
|
+
/**
|
|
180
|
+
* Prompt-1 — runtime session-state snapshot, formatted into a
|
|
181
|
+
* `[Session]` block in the system prompt's dynamic suffix.
|
|
182
|
+
*
|
|
183
|
+
* Surfaces the truth the AI tends to confabulate: whether a
|
|
184
|
+
* cloud-browser session is open, who holds control, what
|
|
185
|
+
* sensitivity tier the session operates at, whether pixel
|
|
186
|
+
* passthrough is granted. Composed by the runtime from a
|
|
187
|
+
* surface-supplied `BrowserSessionInfo` plus its own sensitivity
|
|
188
|
+
* + consent fields.
|
|
189
|
+
*
|
|
190
|
+
* Absent when the runtime hasn't wired a session-state provider
|
|
191
|
+
* (in-tree tests, surfaces without computer-use). Absence means
|
|
192
|
+
* "no session-state context" — the prompt omits the block
|
|
193
|
+
* entirely rather than emitting a misleading "Browser: unknown"
|
|
194
|
+
* default.
|
|
195
|
+
*
|
|
196
|
+
* Doctrine: `packages/sdk/src/session-state.ts` + the
|
|
197
|
+
* PERCEPTION_DOCTRINE block in `packages/ai-core/src/prompt.ts`
|
|
198
|
+
* (runtime gates / state arrive as typed signal, never inference).
|
|
199
|
+
*/
|
|
200
|
+
sessionState?: SessionStateSnapshot;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* One skill body the runtime resolved as relevant for the current turn,
|
|
204
|
+
* passed verbatim into the system prompt (spec/skills-v1.md §7.3). The
|
|
205
|
+
* `provenance` field drives the display badge: `verified` means the
|
|
206
|
+
* envelope signature passed; `trusted_unsigned` means the operator
|
|
207
|
+
* manually attested via `motebit skills trust <name>`.
|
|
208
|
+
*
|
|
209
|
+
* The `score` and `signature` fields are audit-only — they ride into the
|
|
210
|
+
* runtime's `SkillLoaded` event-log emission (§7.4) and are ignored by
|
|
211
|
+
* the AI loop's prompt builder.
|
|
212
|
+
*/
|
|
213
|
+
export interface SkillInjection {
|
|
214
|
+
/** Skill slug (e.g., `"git-commit-motebit-style"`). */
|
|
215
|
+
name: string;
|
|
216
|
+
/** Skill SemVer (e.g., `"1.0.0"`). */
|
|
217
|
+
version: string;
|
|
218
|
+
/** SKILL.md body bytes decoded as UTF-8 — injected into system context verbatim. */
|
|
219
|
+
body: string;
|
|
220
|
+
/** Display-grade provenance status. */
|
|
221
|
+
provenance: "verified" | "trusted_unsigned";
|
|
222
|
+
/** BM25 relevance score from the selector. Audit-only; ignored by the prompt builder. */
|
|
223
|
+
score: number;
|
|
224
|
+
/**
|
|
225
|
+
* Base64url envelope `signature.value`. Empty string when manifest is
|
|
226
|
+
* `trusted_unsigned`. Audit-only; ignored by the prompt builder. The
|
|
227
|
+
* runtime emits this on the `SkillLoaded` event-log entry so a stale
|
|
228
|
+
* audit row whose signature no longer resolves in the registry remains
|
|
229
|
+
* a useful audit signal.
|
|
230
|
+
*/
|
|
231
|
+
signature: string;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Per-turn hook the runtime calls to resolve relevant skills for the
|
|
235
|
+
* current user message. Implementations bind to a SkillRegistry +
|
|
236
|
+
* SkillSelector (in `@motebit/skills`) and return at most top-K skills
|
|
237
|
+
* that pass every gate (§7.2). Returning an empty array is normal
|
|
238
|
+
* (no skills installed, all filtered, or no relevance match).
|
|
239
|
+
*
|
|
240
|
+
* The runtime calls this once per turn at the entry of
|
|
241
|
+
* `sendMessageStreaming` / `sendMessage`. Throws are caught and treated
|
|
242
|
+
* as an empty result — selector failures must never block the AI loop.
|
|
243
|
+
*
|
|
244
|
+
* Adapter pattern: the runtime is unaware of the BSL `@motebit/skills`
|
|
245
|
+
* package; surfaces (CLI / desktop / mobile) wire the concrete impl
|
|
246
|
+
* behind this interface.
|
|
247
|
+
*/
|
|
248
|
+
export interface SkillSelectorHook {
|
|
249
|
+
selectForTurn(turn: string): Promise<SkillInjection[]>;
|
|
152
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* In-memory conversation message. Optional `sensitivity` field is the
|
|
253
|
+
* runtime's effective tier at write time (composed from session tier
|
|
254
|
+
* × tier-bounded slab items via `getEffectiveSessionSensitivity`).
|
|
255
|
+
* Persisted messages carry the same value via the conversation
|
|
256
|
+
* store's `appendMessage`. The runtime's `trimmed()` consumes this
|
|
257
|
+
* field to filter trimmed history at AI-context construction time
|
|
258
|
+
* — read-side companion to the write-side floor that landed in
|
|
259
|
+
* commit 6a3c3b9a. Untagged messages (legacy data, in-memory
|
|
260
|
+
* pre-floor) flow through filters unchanged for backward compat.
|
|
261
|
+
*
|
|
262
|
+
* Same compounding pattern as `MemoryNode.sensitivity` and
|
|
263
|
+
* `SlabItem.sensitivity`: write-side classification → tag → read-
|
|
264
|
+
* side filter. See doctrine: motebit-computer.md §"Mode contract."
|
|
265
|
+
*/
|
|
153
266
|
export type ConversationMessage = {
|
|
154
267
|
role: "user";
|
|
155
268
|
content: string;
|
|
269
|
+
sensitivity?: SensitivityLevel;
|
|
156
270
|
} | {
|
|
157
271
|
role: "assistant";
|
|
158
272
|
content: string;
|
|
159
273
|
tool_calls?: ToolCall[];
|
|
274
|
+
sensitivity?: SensitivityLevel;
|
|
160
275
|
} | {
|
|
161
276
|
role: "tool";
|
|
162
277
|
content: string;
|
|
163
278
|
tool_call_id: string;
|
|
279
|
+
sensitivity?: SensitivityLevel;
|
|
164
280
|
};
|
|
165
281
|
export interface ToolCall {
|
|
166
282
|
id: string;
|
|
@@ -178,6 +294,29 @@ export interface AIResponse {
|
|
|
178
294
|
input_tokens: number;
|
|
179
295
|
output_tokens: number;
|
|
180
296
|
};
|
|
297
|
+
/**
|
|
298
|
+
* Task-step narration — what motebit is currently doing, at the
|
|
299
|
+
* supervisor-cares-about granularity. Single first-person present-
|
|
300
|
+
* tense sentence ("Reading the page" / "Filling in the form" /
|
|
301
|
+
* "Hit a paywall — need your input"). Cap ~80 chars; the chrome is
|
|
302
|
+
* calm. Granularity is between action-step (too noisy) and
|
|
303
|
+
* goal-step (too sparse) — the chunk a supervisor cares about.
|
|
304
|
+
*
|
|
305
|
+
* Consumed by the slab's chrome in the `motebit × virtual_browser`
|
|
306
|
+
* register (and other `motebit × *` cells). Validated by
|
|
307
|
+
* `validateTaskStepNarration` in `@motebit/ai-core` before display
|
|
308
|
+
* — falsified narration is replaced with a runtime-templated
|
|
309
|
+
* fallback so the chrome never renders model claims contradicted
|
|
310
|
+
* by typed truth. Doctrine: third graduation of
|
|
311
|
+
* `runtime-invariants-over-prompt-rules.md`, the typed-truth-
|
|
312
|
+
* perception triple applied to in-flight motebit-voiced text.
|
|
313
|
+
* Architectural primitive: `chrome-as-state-render.md`.
|
|
314
|
+
*
|
|
315
|
+
* Optional. Absent / null when the model didn't emit a narration
|
|
316
|
+
* for this turn (idle, thinking, no active task-step). The chrome
|
|
317
|
+
* recedes to the empty register when absent.
|
|
318
|
+
*/
|
|
319
|
+
task_step_narration?: string;
|
|
181
320
|
}
|
|
182
321
|
export interface IntelligenceProvider {
|
|
183
322
|
generate(contextPack: ContextPack): Promise<AIResponse>;
|
|
@@ -265,6 +404,22 @@ export interface StorageAdapters {
|
|
|
265
404
|
auditLog: AuditLogAdapter;
|
|
266
405
|
stateSnapshot?: StateSnapshotAdapter;
|
|
267
406
|
toolAuditSink?: AuditLogSink;
|
|
407
|
+
/**
|
|
408
|
+
* audit-chain-2 — durable hash-chained audit store. When provided
|
|
409
|
+
* alongside `toolAuditSink`, the runtime wraps the sink in a
|
|
410
|
+
* `ChainedAuditSink` so every appended entry lands in the chain
|
|
411
|
+
* with a `previous_hash`-linked SHA-256 — tamper-evident trail
|
|
412
|
+
* across restart. Surfaces with a SQLite driver pass
|
|
413
|
+
* `new SqliteAuditChainStore(driver)`; surfaces without omit it
|
|
414
|
+
* (the runtime still gets per-entry signed receipts via the
|
|
415
|
+
* existing crypto path; chain-level integrity is the optional
|
|
416
|
+
* upgrade).
|
|
417
|
+
*
|
|
418
|
+
* Doctrine: `audit_chain_signing_endgame` memory + audit-chain-1
|
|
419
|
+
* (`ChainedAuditSink` in `@motebit/policy`) + audit-chain-2
|
|
420
|
+
* (`SqliteAuditChainStore` in `@motebit/persistence`).
|
|
421
|
+
*/
|
|
422
|
+
auditChainStore?: import("@motebit/protocol").AuditChainStoreAdapter;
|
|
268
423
|
conversationStore?: ConversationStoreAdapter;
|
|
269
424
|
planStore?: PlanStoreAdapter;
|
|
270
425
|
gradientStore?: GradientStoreAdapter;
|
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,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;
|
|
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;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,OAAO,KAAK,EACV,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,SAAS,EACT,WAAW,E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QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,EACD,KAAK,EAAE,cAAc,EAAE,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChC"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,8 @@ export * from "./surface-options.js";
|
|
|
9
9
|
export * from "./governance-config.js";
|
|
10
10
|
export * from "./voice-config.js";
|
|
11
11
|
export * from "./appearance-config.js";
|
|
12
|
+
export * from "./pixel-consent.js";
|
|
13
|
+
export * from "./session-state.js";
|
|
12
14
|
// === Relation Types (product — graph semantics for memory edges) ===
|
|
13
15
|
export var RelationType;
|
|
14
16
|
(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,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;
|
|
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;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAgCnC,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,9 +1,42 @@
|
|
|
1
1
|
/** Anthropic Claude models: opus (strongest), sonnet (default), haiku (fast). */
|
|
2
|
-
export declare const ANTHROPIC_MODELS: readonly ["claude-opus-4-
|
|
2
|
+
export declare const ANTHROPIC_MODELS: readonly ["claude-opus-4-7", "claude-sonnet-4-6", "claude-haiku-4-5-20251001"];
|
|
3
3
|
/** OpenAI models: gpt-5.4 (strongest), gpt-5.4-mini (default), gpt-5.4-nano (fast). */
|
|
4
4
|
export declare const OPENAI_MODELS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
|
|
5
5
|
/** Google models: 2.5 pro (strongest), 2.5 flash (default), 2.5 flash-lite (fast). */
|
|
6
6
|
export declare const GOOGLE_MODELS: readonly ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
|
|
7
|
+
/**
|
|
8
|
+
* DeepSeek models served via DeepSeek's OpenAI-compatible hosted API
|
|
9
|
+
* (`https://api.deepseek.com`). The API-facing identifier `deepseek-chat`
|
|
10
|
+
* routes to DeepSeek V3 — the workhorse, tool-use-capable model at
|
|
11
|
+
* roughly Claude-Sonnet-class capability and ~10× cheaper pricing
|
|
12
|
+
* ($0.27/M input · $1.10/M output). DeepSeek-R1 (`deepseek-reasoner`)
|
|
13
|
+
* is reasoning-class but tool-use support is uncertain at the Jan 2026
|
|
14
|
+
* cutoff; deferred to a sibling slice once verified.
|
|
15
|
+
*
|
|
16
|
+
* Single-entry registry today; expandable. The list shape stays
|
|
17
|
+
* symmetric with the other per-vendor `*_MODELS` constants so the
|
|
18
|
+
* settings UIs across surfaces consume them identically.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEEPSEEK_MODELS: readonly ["deepseek-chat"];
|
|
21
|
+
/**
|
|
22
|
+
* Groq-hosted models served via Groq's OpenAI-compatible API
|
|
23
|
+
* (`https://api.groq.com/openai/v1`). Groq's pitch is speed + price —
|
|
24
|
+
* the LPU inference hardware delivers ~280 tokens/second on Llama 3.3
|
|
25
|
+
* 70B (roughly 5× faster than typical GPU-served Llama) at $0.59/M
|
|
26
|
+
* input · $0.79/M output (~5× cheaper than Claude Sonnet, ~5× more
|
|
27
|
+
* expensive than DeepSeek). Independent American option in the BYOK
|
|
28
|
+
* registry — post-NVIDIA-licensing-deal (December 2025) Groq remains
|
|
29
|
+
* an independent company under CEO Simon Edwards; the API service
|
|
30
|
+
* continues. Default `llama-3.3-70b-versatile` is the tool-use-
|
|
31
|
+
* capable workhorse; `openai/gpt-oss-120b` is OpenAI's open-weights
|
|
32
|
+
* release (only hosted competitively via Groq, MoE architecture
|
|
33
|
+
* comparable to GPT-4 class on tool benchmarks).
|
|
34
|
+
*
|
|
35
|
+
* The list shape stays symmetric with the other per-vendor
|
|
36
|
+
* `*_MODELS` constants so the settings UIs across surfaces consume
|
|
37
|
+
* them identically.
|
|
38
|
+
*/
|
|
39
|
+
export declare const GROQ_MODELS: readonly ["llama-3.3-70b-versatile", "openai/gpt-oss-120b"];
|
|
7
40
|
/**
|
|
8
41
|
* Common open-weights models that any local inference server can run.
|
|
9
42
|
*
|
|
@@ -29,13 +62,27 @@ export declare const LOCAL_SERVER_SUGGESTED_MODELS: readonly ["llama3.2", "llama
|
|
|
29
62
|
*/
|
|
30
63
|
export declare const OLLAMA_SUGGESTED_MODELS: readonly ["llama3.2", "llama3.1", "llama3", "mistral", "codellama", "gemma2", "phi3", "qwen2"];
|
|
31
64
|
/** Models available through the Motebit proxy (all cloud providers). */
|
|
32
|
-
export declare const PROXY_MODELS: readonly ["claude-opus-4-
|
|
65
|
+
export declare const PROXY_MODELS: readonly ["claude-opus-4-7", "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"];
|
|
33
66
|
/** Default Anthropic model. */
|
|
34
67
|
export declare const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-6";
|
|
35
68
|
/** Default OpenAI model. */
|
|
36
69
|
export declare const DEFAULT_OPENAI_MODEL = "gpt-5.4-mini";
|
|
37
70
|
/** Default Google model. */
|
|
38
71
|
export declare const DEFAULT_GOOGLE_MODEL = "gemini-2.5-flash";
|
|
72
|
+
/**
|
|
73
|
+
* Default DeepSeek model — V3 via the `deepseek-chat` API identifier.
|
|
74
|
+
* The tool-use-capable workhorse; matches the per-vendor "default tier"
|
|
75
|
+
* convention used by `DEFAULT_ANTHROPIC_MODEL` / `DEFAULT_OPENAI_MODEL` /
|
|
76
|
+
* `DEFAULT_GOOGLE_MODEL`.
|
|
77
|
+
*/
|
|
78
|
+
export declare const DEFAULT_DEEPSEEK_MODEL = "deepseek-chat";
|
|
79
|
+
/**
|
|
80
|
+
* Default Groq model — Llama 3.3 70B served at ~280 tok/sec via the
|
|
81
|
+
* Groq LPU inference stack. Tool-use-capable; matches the per-vendor
|
|
82
|
+
* "default tier" convention used by the other `DEFAULT_*_MODEL`
|
|
83
|
+
* constants.
|
|
84
|
+
*/
|
|
85
|
+
export declare const DEFAULT_GROQ_MODEL = "llama-3.3-70b-versatile";
|
|
39
86
|
/** Default Ollama model — used as the `local-server` default too. */
|
|
40
87
|
export declare const DEFAULT_OLLAMA_MODEL = "llama3.2";
|
|
41
88
|
/**
|
package/dist/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,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c,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
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// When a new model ships, update the arrays — every surface picks it up.
|
|
9
9
|
/** Anthropic Claude models: opus (strongest), sonnet (default), haiku (fast). */
|
|
10
10
|
export const ANTHROPIC_MODELS = [
|
|
11
|
-
"claude-opus-4-
|
|
11
|
+
"claude-opus-4-7",
|
|
12
12
|
"claude-sonnet-4-6",
|
|
13
13
|
"claude-haiku-4-5-20251001",
|
|
14
14
|
];
|
|
@@ -20,6 +20,39 @@ export const GOOGLE_MODELS = [
|
|
|
20
20
|
"gemini-2.5-flash",
|
|
21
21
|
"gemini-2.5-flash-lite",
|
|
22
22
|
];
|
|
23
|
+
/**
|
|
24
|
+
* DeepSeek models served via DeepSeek's OpenAI-compatible hosted API
|
|
25
|
+
* (`https://api.deepseek.com`). The API-facing identifier `deepseek-chat`
|
|
26
|
+
* routes to DeepSeek V3 — the workhorse, tool-use-capable model at
|
|
27
|
+
* roughly Claude-Sonnet-class capability and ~10× cheaper pricing
|
|
28
|
+
* ($0.27/M input · $1.10/M output). DeepSeek-R1 (`deepseek-reasoner`)
|
|
29
|
+
* is reasoning-class but tool-use support is uncertain at the Jan 2026
|
|
30
|
+
* cutoff; deferred to a sibling slice once verified.
|
|
31
|
+
*
|
|
32
|
+
* Single-entry registry today; expandable. The list shape stays
|
|
33
|
+
* symmetric with the other per-vendor `*_MODELS` constants so the
|
|
34
|
+
* settings UIs across surfaces consume them identically.
|
|
35
|
+
*/
|
|
36
|
+
export const DEEPSEEK_MODELS = ["deepseek-chat"];
|
|
37
|
+
/**
|
|
38
|
+
* Groq-hosted models served via Groq's OpenAI-compatible API
|
|
39
|
+
* (`https://api.groq.com/openai/v1`). Groq's pitch is speed + price —
|
|
40
|
+
* the LPU inference hardware delivers ~280 tokens/second on Llama 3.3
|
|
41
|
+
* 70B (roughly 5× faster than typical GPU-served Llama) at $0.59/M
|
|
42
|
+
* input · $0.79/M output (~5× cheaper than Claude Sonnet, ~5× more
|
|
43
|
+
* expensive than DeepSeek). Independent American option in the BYOK
|
|
44
|
+
* registry — post-NVIDIA-licensing-deal (December 2025) Groq remains
|
|
45
|
+
* an independent company under CEO Simon Edwards; the API service
|
|
46
|
+
* continues. Default `llama-3.3-70b-versatile` is the tool-use-
|
|
47
|
+
* capable workhorse; `openai/gpt-oss-120b` is OpenAI's open-weights
|
|
48
|
+
* release (only hosted competitively via Groq, MoE architecture
|
|
49
|
+
* comparable to GPT-4 class on tool benchmarks).
|
|
50
|
+
*
|
|
51
|
+
* The list shape stays symmetric with the other per-vendor
|
|
52
|
+
* `*_MODELS` constants so the settings UIs across surfaces consume
|
|
53
|
+
* them identically.
|
|
54
|
+
*/
|
|
55
|
+
export const GROQ_MODELS = ["llama-3.3-70b-versatile", "openai/gpt-oss-120b"];
|
|
23
56
|
/**
|
|
24
57
|
* Common open-weights models that any local inference server can run.
|
|
25
58
|
*
|
|
@@ -55,7 +88,7 @@ export const LOCAL_SERVER_SUGGESTED_MODELS = [
|
|
|
55
88
|
export const OLLAMA_SUGGESTED_MODELS = LOCAL_SERVER_SUGGESTED_MODELS;
|
|
56
89
|
/** Models available through the Motebit proxy (all cloud providers). */
|
|
57
90
|
export const PROXY_MODELS = [
|
|
58
|
-
"claude-opus-4-
|
|
91
|
+
"claude-opus-4-7",
|
|
59
92
|
"claude-sonnet-4-6",
|
|
60
93
|
"claude-haiku-4-5-20251001",
|
|
61
94
|
"gpt-5.4",
|
|
@@ -72,6 +105,20 @@ export const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-6";
|
|
|
72
105
|
export const DEFAULT_OPENAI_MODEL = "gpt-5.4-mini";
|
|
73
106
|
/** Default Google model. */
|
|
74
107
|
export const DEFAULT_GOOGLE_MODEL = "gemini-2.5-flash";
|
|
108
|
+
/**
|
|
109
|
+
* Default DeepSeek model — V3 via the `deepseek-chat` API identifier.
|
|
110
|
+
* The tool-use-capable workhorse; matches the per-vendor "default tier"
|
|
111
|
+
* convention used by `DEFAULT_ANTHROPIC_MODEL` / `DEFAULT_OPENAI_MODEL` /
|
|
112
|
+
* `DEFAULT_GOOGLE_MODEL`.
|
|
113
|
+
*/
|
|
114
|
+
export const DEFAULT_DEEPSEEK_MODEL = "deepseek-chat";
|
|
115
|
+
/**
|
|
116
|
+
* Default Groq model — Llama 3.3 70B served at ~280 tok/sec via the
|
|
117
|
+
* Groq LPU inference stack. Tool-use-capable; matches the per-vendor
|
|
118
|
+
* "default tier" convention used by the other `DEFAULT_*_MODEL`
|
|
119
|
+
* constants.
|
|
120
|
+
*/
|
|
121
|
+
export const DEFAULT_GROQ_MODEL = "llama-3.3-70b-versatile";
|
|
75
122
|
/** Default Ollama model — used as the `local-server` default too. */
|
|
76
123
|
export const DEFAULT_OLLAMA_MODEL = "llama3.2";
|
|
77
124
|
/**
|
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,sGAAsG;AACtG,4EAA4E;AAC5E,EAAE;AACF,kDAAkD;AAClD,yEAAyE;AAEzE,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBA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AC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAE5D,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,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-session pixel-passthrough consent state.
|
|
3
|
+
*
|
|
4
|
+
* - `denied` (default): pixels never reach an external AI provider.
|
|
5
|
+
* `projectForAi` swaps `bytes_base64` for a `bytes_omitted` directive
|
|
6
|
+
* pointing the AI at the `/vision grant` affordance.
|
|
7
|
+
* - `session`: the user granted pixel passthrough for the lifetime of
|
|
8
|
+
* this session. External providers receive bytes when sensitivity
|
|
9
|
+
* permits. Reverts to `denied` on session end (no persistence).
|
|
10
|
+
*
|
|
11
|
+
* Future extensions (deferred until per-domain demand lands): a
|
|
12
|
+
* `{ kind: "domain"; domains: string[] }` variant for "always allow on
|
|
13
|
+
* example.com" — same shape as browser camera/mic permissions. Adding
|
|
14
|
+
* a variant is additive; existing consumers route on the string-literal
|
|
15
|
+
* cases they care about.
|
|
16
|
+
*
|
|
17
|
+
* Sovereign providers (`on-device` mode) bypass this gate entirely —
|
|
18
|
+
* the bytes never cross a network boundary.
|
|
19
|
+
*/
|
|
20
|
+
export type PixelConsentState = "denied" | "session";
|
|
21
|
+
/** Default pixel consent for a fresh session — fail-closed. */
|
|
22
|
+
export declare const DEFAULT_PIXEL_CONSENT: PixelConsentState;
|
|
23
|
+
/**
|
|
24
|
+
* Structured reason a `bytes_omitted` directive carries when pixels were
|
|
25
|
+
* stripped. Lets the AI's perception doctrine route to the right
|
|
26
|
+
* remediation: a `consent_required` strip points at `/vision grant`;
|
|
27
|
+
* a `sensitivity_blocked` strip points at `/sensitivity none`; a
|
|
28
|
+
* `no_capability` strip points at "switch provider." The AI doesn't
|
|
29
|
+
* have to parse human text — it routes on the typed reason.
|
|
30
|
+
*/
|
|
31
|
+
export type PixelOmittedReason = "consent_required" | "sensitivity_blocked" | "no_capability";
|
|
32
|
+
//# sourceMappingURL=pixel-consent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixel-consent.d.ts","sourceRoot":"","sources":["../src/pixel-consent.ts"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErD,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,EAAE,iBAA4B,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG,qBAAqB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// === Pixel Consent (Visual-Perception Boundary) ===
|
|
2
|
+
//
|
|
3
|
+
// Pixels — screenshots, navigate-frame captures, future image embedding
|
|
4
|
+
// payloads — cross a different sovereignty boundary than text. Text from
|
|
5
|
+
// a tool result is the kind of content the AI is built to reason about;
|
|
6
|
+
// pixels are raw bytes whose content the user may not have consented to
|
|
7
|
+
// share with the active provider (banking screens, medical records,
|
|
8
|
+
// anything caught incidentally on the slab).
|
|
9
|
+
//
|
|
10
|
+
// The architecture composes three gates around pixel passthrough:
|
|
11
|
+
//
|
|
12
|
+
// 1. Provider sovereignty — `on-device` providers always receive
|
|
13
|
+
// pixels. The bytes never leave the device, so there is no
|
|
14
|
+
// external party to consent to.
|
|
15
|
+
// 2. Session sensitivity — medical / financial / secret sessions
|
|
16
|
+
// with an external provider always strip pixels. Same fail-closed
|
|
17
|
+
// shape as `assertSensitivityPermitsAiCall` for outbound text.
|
|
18
|
+
// 3. Pixel consent — for external providers at unelevated sensitivity,
|
|
19
|
+
// the user must explicitly grant pixel passthrough. This file
|
|
20
|
+
// defines that grant's shape.
|
|
21
|
+
//
|
|
22
|
+
// Doctrine — composes existing primitives rather than introducing a new
|
|
23
|
+
// tool:
|
|
24
|
+
//
|
|
25
|
+
// - `motebit-computer.md` §"Mode contract" — pixel-tier perception
|
|
26
|
+
// is a function of (provider, sensitivity, consent), not a separate
|
|
27
|
+
// tool. One pixel-tier tool (`computer({kind:"screenshot"})`),
|
|
28
|
+
// multiple gates threaded through `projectForAi`.
|
|
29
|
+
// - `surface-determinism.md` (Principle 90) — consent is granted via
|
|
30
|
+
// a typed affordance (slash command, slab band) NEVER through an
|
|
31
|
+
// AI prompt asking "may I see?". The AI's only role is to surface
|
|
32
|
+
// `bytes_omitted: { reason: "consent_required" }` and let the
|
|
33
|
+
// surface route the user to the affordance.
|
|
34
|
+
// - `proactive-interior.md` — fail-closed by default. New sessions
|
|
35
|
+
// start at `denied`; pixel pass-through is opt-in.
|
|
36
|
+
/** Default pixel consent for a fresh session — fail-closed. */
|
|
37
|
+
export const DEFAULT_PIXEL_CONSENT = "denied";
|
|
38
|
+
//# sourceMappingURL=pixel-consent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixel-consent.js","sourceRoot":"","sources":["../src/pixel-consent.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AACxE,wEAAwE;AACxE,oEAAoE;AACpE,6CAA6C;AAC7C,EAAE;AACF,kEAAkE;AAClE,EAAE;AACF,mEAAmE;AACnE,gEAAgE;AAChE,qCAAqC;AACrC,mEAAmE;AACnE,uEAAuE;AACvE,oEAAoE;AACpE,yEAAyE;AACzE,mEAAmE;AACnE,mCAAmC;AACnC,EAAE;AACF,wEAAwE;AACxE,QAAQ;AACR,EAAE;AACF,qEAAqE;AACrE,wEAAwE;AACxE,mEAAmE;AACnE,sDAAsD;AACtD,uEAAuE;AACvE,qEAAqE;AACrE,sEAAsE;AACtE,kEAAkE;AAClE,gDAAgD;AAChD,qEAAqE;AACrE,uDAAuD;AAuBvD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAsB,QAAQ,CAAC"}
|
package/dist/provider-mode.d.ts
CHANGED
|
@@ -16,8 +16,28 @@ export type ProviderMode = "on-device" | "motebit-cloud" | "byok";
|
|
|
16
16
|
* (Ollama, LM Studio, llama.cpp, Jan, vLLM, …). Vendor-agnostic.
|
|
17
17
|
*/
|
|
18
18
|
export type OnDeviceBackend = "apple-fm" | "mlx" | "webllm" | "local-server";
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* BYOK vendors — the only ones where the user holds the API key directly.
|
|
21
|
+
*
|
|
22
|
+
* Closed-set additive registry; fourth instance of the agility-as-role
|
|
23
|
+
* pattern (`docs/doctrine/agility-as-role.md` — alongside `SuiteId` for
|
|
24
|
+
* cryptosuites, "permissive floor" for licenses, `GuestRail`/`SovereignRail`
|
|
25
|
+
* for settlement). The role is "foundation-model vendor accessible via
|
|
26
|
+
* OpenAI-compatible wire protocol (or Anthropic's, for Anthropic itself)."
|
|
27
|
+
* Adding a vendor is a registry append + dispatch arm + default-model
|
|
28
|
+
* entry; the closure is enforced by exhaustive-switch typechecks in
|
|
29
|
+
* `provider-resolver.ts` and the api-extractor baseline gate.
|
|
30
|
+
*
|
|
31
|
+
* `deepseek` lands as the fourth instance — DeepSeek V3 is roughly
|
|
32
|
+
* Claude-Sonnet-class on tool-use benchmarks at ~10× cheaper pricing,
|
|
33
|
+
* served via DeepSeek's OpenAI-compatible API. Closes the doctrinal
|
|
34
|
+
* asymmetry where motebit's "intelligence is pluggable" founding claim
|
|
35
|
+
* (`CLAUDE.md` opening) was contradicted by a 3-vendor registry of
|
|
36
|
+
* exclusively-expensive Big Tech providers. The role stays closed at
|
|
37
|
+
* the wire-vocab boundary; affordability lands now for capital-
|
|
38
|
+
* constrained users via the additive registry shape.
|
|
39
|
+
*/
|
|
40
|
+
export type ByokVendor = "anthropic" | "openai" | "google" | "groq" | "deepseek";
|
|
21
41
|
/** On-device mode config. */
|
|
22
42
|
export interface OnDeviceProviderConfig {
|
|
23
43
|
mode: "on-device";
|
|
@@ -1 +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
|
|
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;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAEjF,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-mode.js","sourceRoot":"","sources":["../src/provider-mode.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,EAAE;AACF,mFAAmF;AACnF,qFAAqF;AACrF,qDAAqD;AACrD,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;
|
|
1
|
+
{"version":3,"file":"provider-mode.js","sourceRoot":"","sources":["../src/provider-mode.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,EAAE;AACF,mFAAmF;AACnF,qFAAqF;AACrF,qDAAqD;AACrD,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AA6F/E,oBAAoB;AACpB,EAAE;AACF,oDAAoD;AACpD,EAAE;AACF,mCAAmC;AACnC,sEAAsE;AACtE,0EAA0E;AAC1E,EAAE;AACF,4CAA4C;AAC5C,oFAAoF;AACpF,2CAA2C;AAC3C,uDAAuD;AACvD,EAAE;AACF,yCAAyC;AACzC,0EAA0E;AAC1E,sCAAsC;AACtC,EAAE;AACF,kCAAkC;AAClC,8DAA8D;AAC9D,gDAAgD;AAEhD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAA8B;IAC7D,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACtC,OAAO,CACL,IAAI,KAAK,WAAW;YACpB,IAAI,KAAK,WAAW;YACpB,IAAI,KAAK,KAAK;YACd,IAAI,KAAK,SAAS;YAClB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAClB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;YACxB,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,CACxC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,mBAAmB;AAEnB,+DAA+D;AAC/D,MAAM,UAAU,qBAAqB;IACnC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -10,6 +10,24 @@ export declare const GOOGLE_OPENAI_COMPAT_URL = "https://generativelanguage.goog
|
|
|
10
10
|
export declare const ANTHROPIC_CANONICAL_URL = "https://api.anthropic.com";
|
|
11
11
|
/** Canonical OpenAI API base URL. */
|
|
12
12
|
export declare const OPENAI_CANONICAL_URL = "https://api.openai.com/v1";
|
|
13
|
+
/**
|
|
14
|
+
* Canonical DeepSeek API base URL. DeepSeek exposes an OpenAI-compatible
|
|
15
|
+
* chat-completions endpoint at `{base}/chat/completions`; the BYOK arm
|
|
16
|
+
* routes through `OpenAIProvider` the same way Google does. Single
|
|
17
|
+
* source of truth — surfaces that need a CORS proxy or dev rewrite
|
|
18
|
+
* substitute via `env.cloudBaseUrl`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEEPSEEK_CANONICAL_URL = "https://api.deepseek.com";
|
|
21
|
+
/**
|
|
22
|
+
* Canonical Groq API base URL. Groq exposes an OpenAI-compatible
|
|
23
|
+
* chat-completions endpoint at `{base}/chat/completions` (the
|
|
24
|
+
* `/openai/v1` path segment is part of Groq's URL — they namespace
|
|
25
|
+
* the OpenAI-shape API explicitly). The BYOK arm routes through
|
|
26
|
+
* `OpenAIProvider`, same path as Google / DeepSeek. Single source of
|
|
27
|
+
* truth — surfaces that need a CORS proxy or dev rewrite substitute
|
|
28
|
+
* via `env.cloudBaseUrl`.
|
|
29
|
+
*/
|
|
30
|
+
export declare const GROQ_CANONICAL_URL = "https://api.groq.com/openai/v1";
|
|
13
31
|
/** Default Motebit Cloud relay URL. Surfaces may override via env. */
|
|
14
32
|
export declare const DEFAULT_MOTEBIT_CLOUD_URL = "https://api.motebit.com";
|
|
15
33
|
/** Default WebLLM model when none specified — small enough to fit on most devices. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-resolver.d.ts","sourceRoot":"","sources":["../src/provider-resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider-resolver.d.ts","sourceRoot":"","sources":["../src/provider-resolver.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI7F;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,4DAA4D,CAAC;AAElG,wCAAwC;AACxC,eAAO,M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AC,EAAE,MAAM,CAAC;CACtB;AAED,0DAA0D;AAC1D,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;OAQG;IACH,YAAY,CAAC,YAAY,EAAE,WAAW,GAAG,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAE9E;;;;;;OAMG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;;;;;;;;OASG;IACH,kBAAkB,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAE7C;;;;;;OAMG;IACH,iBAAiB,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAEhD;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7C;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAID;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAC7B,OAAO,EAAE,eAAe;gBAAxB,OAAO,EAAE,eAAe;CAI5C;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,WAAW,GAAG,YAAY,CAkGjG"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
// - The Google "uses OpenAI-compat" fact
|
|
34
34
|
// - Default model fallback per vendor
|
|
35
35
|
// - The supported-backends gate
|
|
36
|
-
import { DEFAULT_ANTHROPIC_MODEL, DEFAULT_OPENAI_MODEL, DEFAULT_GOOGLE_MODEL, DEFAULT_OLLAMA_MODEL, DEFAULT_PROXY_MODEL, } from "./models.js";
|
|
36
|
+
import { DEFAULT_ANTHROPIC_MODEL, DEFAULT_OPENAI_MODEL, DEFAULT_GOOGLE_MODEL, DEFAULT_DEEPSEEK_MODEL, DEFAULT_GROQ_MODEL, DEFAULT_OLLAMA_MODEL, DEFAULT_PROXY_MODEL, } from "./models.js";
|
|
37
37
|
// === Constants ===
|
|
38
38
|
/**
|
|
39
39
|
* Google's OpenAI-compatible chat completions endpoint. Used when the user
|
|
@@ -46,6 +46,24 @@ export const GOOGLE_OPENAI_COMPAT_URL = "https://generativelanguage.googleapis.c
|
|
|
46
46
|
export const ANTHROPIC_CANONICAL_URL = "https://api.anthropic.com";
|
|
47
47
|
/** Canonical OpenAI API base URL. */
|
|
48
48
|
export const OPENAI_CANONICAL_URL = "https://api.openai.com/v1";
|
|
49
|
+
/**
|
|
50
|
+
* Canonical DeepSeek API base URL. DeepSeek exposes an OpenAI-compatible
|
|
51
|
+
* chat-completions endpoint at `{base}/chat/completions`; the BYOK arm
|
|
52
|
+
* routes through `OpenAIProvider` the same way Google does. Single
|
|
53
|
+
* source of truth — surfaces that need a CORS proxy or dev rewrite
|
|
54
|
+
* substitute via `env.cloudBaseUrl`.
|
|
55
|
+
*/
|
|
56
|
+
export const DEEPSEEK_CANONICAL_URL = "https://api.deepseek.com";
|
|
57
|
+
/**
|
|
58
|
+
* Canonical Groq API base URL. Groq exposes an OpenAI-compatible
|
|
59
|
+
* chat-completions endpoint at `{base}/chat/completions` (the
|
|
60
|
+
* `/openai/v1` path segment is part of Groq's URL — they namespace
|
|
61
|
+
* the OpenAI-shape API explicitly). The BYOK arm routes through
|
|
62
|
+
* `OpenAIProvider`, same path as Google / DeepSeek. Single source of
|
|
63
|
+
* truth — surfaces that need a CORS proxy or dev rewrite substitute
|
|
64
|
+
* via `env.cloudBaseUrl`.
|
|
65
|
+
*/
|
|
66
|
+
export const GROQ_CANONICAL_URL = "https://api.groq.com/openai/v1";
|
|
49
67
|
/** Default Motebit Cloud relay URL. Surfaces may override via env. */
|
|
50
68
|
export const DEFAULT_MOTEBIT_CLOUD_URL = "https://api.motebit.com";
|
|
51
69
|
/** Default WebLLM model when none specified — small enough to fit on most devices. */
|
|
@@ -85,6 +103,10 @@ export function defaultModelForVendor(vendor) {
|
|
|
85
103
|
return DEFAULT_OPENAI_MODEL;
|
|
86
104
|
case "google":
|
|
87
105
|
return DEFAULT_GOOGLE_MODEL;
|
|
106
|
+
case "groq":
|
|
107
|
+
return DEFAULT_GROQ_MODEL;
|
|
108
|
+
case "deepseek":
|
|
109
|
+
return DEFAULT_DEEPSEEK_MODEL;
|
|
88
110
|
}
|
|
89
111
|
}
|
|
90
112
|
/**
|
|
@@ -100,6 +122,10 @@ export function canonicalVendorBaseUrl(vendor) {
|
|
|
100
122
|
return OPENAI_CANONICAL_URL;
|
|
101
123
|
case "google":
|
|
102
124
|
return GOOGLE_OPENAI_COMPAT_URL;
|
|
125
|
+
case "groq":
|
|
126
|
+
return GROQ_CANONICAL_URL;
|
|
127
|
+
case "deepseek":
|
|
128
|
+
return DEEPSEEK_CANONICAL_URL;
|
|
103
129
|
}
|
|
104
130
|
}
|
|
105
131
|
// === Errors ===
|
|
@@ -150,9 +176,11 @@ export function resolveProviderSpec(config, env) {
|
|
|
150
176
|
};
|
|
151
177
|
}
|
|
152
178
|
case "byok": {
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
//
|
|
179
|
+
// OpenAI-compat vendors (google, deepseek) dispatch through the
|
|
180
|
+
// OpenAI wire protocol — their hosted APIs expose
|
|
181
|
+
// `/chat/completions` with the same schema. Anthropic uses its
|
|
182
|
+
// own canonical wire protocol. The arm picks `anthropic` when the
|
|
183
|
+
// vendor is `"anthropic"`, otherwise `openai`.
|
|
156
184
|
const wireProtocol = config.vendor === "anthropic" ? "anthropic" : "openai";
|
|
157
185
|
const canonical = config.baseUrl ?? canonicalVendorBaseUrl(config.vendor);
|
|
158
186
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-resolver.js","sourceRoot":"","sources":["../src/provider-resolver.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,qCAAqC;AACrC,EAAE;AACF,wEAAwE;AACxE,+EAA+E;AAC/E,4EAA4E;AAC5E,gFAAgF;AAChF,4EAA4E;AAC5E,2EAA2E;AAC3E,uEAAuE;AACvE,yEAAyE;AACzE,iCAAiC;AACjC,EAAE;AACF,6EAA6E;AAC7E,gEAAgE;AAChE,EAAE;AACF,2CAA2C;AAC3C,gEAAgE;AAChE,sEAAsE;AACtE,2DAA2D;AAC3D,iFAAiF;AACjF,EAAE;AACF,qCAAqC;AACrC,kDAAkD;AAClD,qDAAqD;AACrD,2CAA2C;AAC3C,wCAAwC;AACxC,kCAAkC;AAElC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAGrB,oBAAoB;AAEpB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,yDAAyD,CAAC;AAElG,wCAAwC;AACxC,MAAM,CAAC,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;AAEnE,qCAAqC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAEhE,sEAAsE;AACtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAEnE,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AAExE,kBAAkB;AAElB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,4BAA4B,CAAC,GAAW;IACtD,MAAM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R,OAAO;wBACL,IAAI,EAAE,KAAK;wBACX,KAAK,EAAE,MAAM,CAAC,KAAK;wBACnB,SAAS,EAAE,MAAM,CAAC,SAAS;qBAC5B,CAAC;gBACJ,KAAK,cAAc,CAAC,CAAC,CAAC;oBACpB,6DAA6D;oBAC7D,6DAA6D;oBAC7D,kEAAkE;oBAClE,iEAAiE;oBACjE,mEAAmE;oBACnE,4CAA4C;oBAC5C,EAAE;oBACF,iEAAiE;oBACjE,kEAAkE;oBAClE,2DAA2D;oBAC3D,0DAA0D;oBAC1D,gEAAgE;oBAChE,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC,qBAAqB,CAAC;oBACrE,MAAM,kBAAkB,GAAG,GAAG,CAAC,kBAAkB,EAAE,CAAC,eAAe,CAAC,IAAI,eAAe,CAAC;oBACxF,MAAM,cAAc,GAAG,4BAA4B,CAAC,kBAAkB,CAAC,CAAC;oBACxE,OAAO;wBACL,IAAI,EAAE,OAAO;wBACb,YAAY,EAAE,QAAQ;wBACtB,8DAA8D;wBAC9D,2DAA2D;wBAC3D,MAAM,EAAE,OAAO;wBACf,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,oBAAoB;wBAC3C,OAAO,EAAE,cAAc;wBACvB,SAAS,EAAE,MAAM,CAAC,SAAS;wBAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;qBAChC,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { ControlState } from "./index.js";
|
|
2
|
+
import type { SensitivityLevel } from "./index.js";
|
|
3
|
+
import type { PixelConsentState } from "./pixel-consent.js";
|
|
4
|
+
/**
|
|
5
|
+
* Cloud-browser session info — populated by the surface that owns
|
|
6
|
+
* the session lifecycle (web's `registerWebComputerTool`).
|
|
7
|
+
* Surfaces without a virtual_browser embodiment (desktop_drive,
|
|
8
|
+
* sandboxed) report `status: "closed"` always — those surfaces
|
|
9
|
+
* don't expose `computer({navigate})` at all, so the AI shouldn't
|
|
10
|
+
* be reasoning about a browser session there.
|
|
11
|
+
*/
|
|
12
|
+
export interface BrowserSessionInfo {
|
|
13
|
+
/**
|
|
14
|
+
* Whether motebit currently has an active virtual_browser
|
|
15
|
+
* session. `closed` means no live screencast, no Chromium
|
|
16
|
+
* process; the AI must call a tool to open one before
|
|
17
|
+
* navigating / reading / screenshotting.
|
|
18
|
+
*/
|
|
19
|
+
readonly status: "closed" | "open";
|
|
20
|
+
/**
|
|
21
|
+
* URL of the page motebit is currently looking at. Present
|
|
22
|
+
* only when `status === "open"` AND the surface is tracking
|
|
23
|
+
* navigation events. May be omitted (`undefined`) if the
|
|
24
|
+
* surface hasn't wired URL tracking yet — absent means
|
|
25
|
+
* "we don't know," not "no URL."
|
|
26
|
+
*/
|
|
27
|
+
readonly url?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Co-browse control state — who's driving. Present when
|
|
30
|
+
* `status === "open"` AND the session has a co-browse machine
|
|
31
|
+
* (web). Absent on surfaces without co-browse (desktop_drive
|
|
32
|
+
* v1).
|
|
33
|
+
*/
|
|
34
|
+
readonly control?: ControlState;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Full runtime session-state snapshot — composed by the runtime
|
|
38
|
+
* from per-surface browser info plus its own sensitivity and
|
|
39
|
+
* consent fields. Threaded through `MotebitLoopOptions` →
|
|
40
|
+
* `ContextPack.sessionState` → the system prompt's dynamic
|
|
41
|
+
* suffix as a `[Session]` block.
|
|
42
|
+
*
|
|
43
|
+
* v1 surface scope: web (cloud-browser embodiment). Desktop and
|
|
44
|
+
* mobile surfaces will populate the same shape with their own
|
|
45
|
+
* embodiment's state when the prompt-1 pattern lands there.
|
|
46
|
+
*/
|
|
47
|
+
export interface SessionStateSnapshot {
|
|
48
|
+
/** Cloud-browser session info from the surface. */
|
|
49
|
+
readonly browser: BrowserSessionInfo;
|
|
50
|
+
/** Effective session sensitivity tier — runtime-owned, applies to all AI calls. */
|
|
51
|
+
readonly sensitivity: SensitivityLevel;
|
|
52
|
+
/** Per-session pixel-passthrough consent — runtime-owned. */
|
|
53
|
+
readonly pixelConsent: PixelConsentState;
|
|
54
|
+
/**
|
|
55
|
+
* Stale-omission signal — set when a prior tool result in this
|
|
56
|
+
* conversation emitted `bytes_omitted_reason: <r>` but the gate
|
|
57
|
+
* that fired `<r>` is no longer firing under the current state.
|
|
58
|
+
* Carries the prior reason so the prompt can teach the AI to
|
|
59
|
+
* recover correctly (re-take, don't re-recommend an already-
|
|
60
|
+
* granted affordance).
|
|
61
|
+
*
|
|
62
|
+
* The classic case: AI screenshot returns `bytes_omitted_reason:
|
|
63
|
+
* "consent_required"`; user types `/vision grant`; AI's next turn
|
|
64
|
+
* still references the historical omission and recommends
|
|
65
|
+
* `/vision grant` to a user who already granted it. This signal is
|
|
66
|
+
* the runtime telling the AI: "your prior omission is stale; the
|
|
67
|
+
* gate has flipped."
|
|
68
|
+
*
|
|
69
|
+
* Absent (undefined) means either no omission has fired this
|
|
70
|
+
* conversation OR the gate that fired is still firing (the
|
|
71
|
+
* omission isn't stale). The PERCEPTION_DOCTRINE clause in
|
|
72
|
+
* `@motebit/ai-core::prompt` teaches: if this field is present in
|
|
73
|
+
* the [Now] block, re-take before answering and DO NOT re-recommend
|
|
74
|
+
* the affordance for the stale reason.
|
|
75
|
+
*
|
|
76
|
+
* Doctrine: `motebit-computer.md` §"Typed truth on results" — same
|
|
77
|
+
* shape as `frame_stale` and `not_in_control`. Typed wire field +
|
|
78
|
+
* prompt clause + dispatch enforcement (the runtime computes the
|
|
79
|
+
* staleness, the AI doesn't have to cross-reference history).
|
|
80
|
+
*/
|
|
81
|
+
readonly staleBytesOmissionReason?: import("./pixel-consent.js").PixelOmittedReason;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=session-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-state.d.ts","sourceRoot":"","sources":["../src/session-state.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;CACjC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,mFAAmF;IACnF,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,6DAA6D;IAC7D,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,oBAAoB,EAAE,kBAAkB,CAAC;CACrF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// === Runtime Session State (Prompt-1) ===
|
|
2
|
+
//
|
|
3
|
+
// Snapshot of the runtime state that the AI's reasoning needs to
|
|
4
|
+
// know about THIS turn — injected into the system prompt's dynamic
|
|
5
|
+
// suffix as a `[Session]` block. The shape exists because of a
|
|
6
|
+
// recurring hallucination pattern witnessed across the co-browse
|
|
7
|
+
// arc: the AI claims runtime state ("browser is already open",
|
|
8
|
+
// "there's a sensitivity hold", "I haven't seen the pixels") from
|
|
9
|
+
// memory rather than from a typed signal. The fix is to surface
|
|
10
|
+
// the truth in the prompt so the AI can read it instead of
|
|
11
|
+
// inferring.
|
|
12
|
+
//
|
|
13
|
+
// Same shape as the existing `[Body]` and `[State]` blocks — they
|
|
14
|
+
// expose creature mood and body cues. `[Session]` exposes the
|
|
15
|
+
// runtime's session-level state: cloud-browser status, control
|
|
16
|
+
// holder, effective sensitivity tier, pixel-passthrough consent.
|
|
17
|
+
//
|
|
18
|
+
// Doctrine: `motebit-computer.md` §"Mode contract" + the
|
|
19
|
+
// PERCEPTION_DOCTRINE block in `packages/ai-core/src/prompt.ts`
|
|
20
|
+
// (perception integrity — runtime state arrives as typed signal,
|
|
21
|
+
// never as inference).
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=session-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-state.js","sourceRoot":"","sources":["../src/session-state.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,+DAA+D;AAC/D,iEAAiE;AACjE,+DAA+D;AAC/D,kEAAkE;AAClE,gEAAgE;AAChE,2DAA2D;AAC3D,aAAa;AACb,EAAE;AACF,kEAAkE;AAClE,8DAA8D;AAC9D,+DAA+D;AAC/D,iEAAiE;AACjE,EAAE;AACF,yDAAyD;AACzD,gEAAgE;AAChE,iEAAiE;AACjE,uBAAuB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motebit/sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Developer contract for building Motebit-powered agents, services, and integrations — stable types, adapter interfaces, governance config. Re-exports @motebit/protocol.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@motebit/protocol": "1.
|
|
50
|
+
"@motebit/protocol": "1.3.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^22.0.0",
|