@motebit/protocol 1.1.0 → 1.3.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/artifact-type.d.ts +118 -0
- package/dist/artifact-type.d.ts.map +1 -0
- package/dist/artifact-type.js +97 -0
- package/dist/artifact-type.js.map +1 -0
- package/dist/audience.d.ts +108 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/audience.js +104 -0
- package/dist/audience.js.map +1 -0
- package/dist/co-browse.d.ts +369 -0
- package/dist/co-browse.d.ts.map +1 -0
- package/dist/co-browse.js +64 -0
- package/dist/co-browse.js.map +1 -0
- package/dist/computer-use.d.ts +463 -3
- package/dist/computer-use.d.ts.map +1 -1
- package/dist/computer-use.js +40 -0
- package/dist/computer-use.js.map +1 -1
- package/dist/dispute.d.ts +150 -4
- package/dist/dispute.d.ts.map +1 -1
- package/dist/index.d.ts +311 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -1
- package/dist/memory-events.d.ts +1 -1
- package/dist/memory-events.js +1 -1
- package/dist/money.d.ts +33 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/money.js +41 -0
- package/dist/money.js.map +1 -0
- package/dist/perception.d.ts +308 -0
- package/dist/perception.d.ts.map +1 -0
- package/dist/perception.js +9 -0
- package/dist/perception.js.map +1 -0
- package/dist/retention-policy.d.ts +464 -0
- package/dist/retention-policy.d.ts.map +1 -0
- package/dist/retention-policy.js +128 -0
- package/dist/retention-policy.js.map +1 -0
- package/dist/sensitivity.d.ts +73 -0
- package/dist/sensitivity.d.ts.map +1 -0
- package/dist/sensitivity.js +97 -0
- package/dist/sensitivity.js.map +1 -0
- package/dist/skills.d.ts +334 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +44 -0
- package/dist/skills.js.map +1 -0
- package/dist/transparency.d.ts +116 -0
- package/dist/transparency.d.ts.map +1 -0
- package/dist/transparency.js +67 -0
- package/dist/transparency.js.map +1 -0
- package/package.json +1 -1
package/dist/dispute.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* for dispute resolution in agent-to-agent delegations. Any implementation can
|
|
6
6
|
* produce and verify dispute artifacts using these types.
|
|
7
7
|
*/
|
|
8
|
+
import type { MerkleInclusionProof } from "./retention-policy.js";
|
|
8
9
|
/** Dispute lifecycle states. Terminal states (final, expired) are irreversible. */
|
|
9
10
|
export type DisputeState = "opened" | "evidence" | "arbitration" | "resolved" | "appealed" | "final" | "expired";
|
|
10
11
|
/** Dispute resolution outcome. */
|
|
@@ -87,10 +88,12 @@ export interface DisputeEvidence {
|
|
|
87
88
|
* Foundation Law (§6.5):
|
|
88
89
|
* - Federation resolution must include individual AdjudicatorVote entries
|
|
89
90
|
* - Aggregated-only verdicts are rejected
|
|
90
|
-
* - Each vote signature MUST cover `dispute_id` — votes are
|
|
91
|
-
* across disputes (a malicious
|
|
92
|
-
*
|
|
93
|
-
* dispute_id binding breaks
|
|
91
|
+
* - Each vote signature MUST cover `dispute_id` AND `round` — votes are
|
|
92
|
+
* not portable across disputes OR adjudication rounds (a malicious
|
|
93
|
+
* adjudicator collecting old votes from other disputes cannot stuff
|
|
94
|
+
* them into a new resolution because the dispute_id binding breaks
|
|
95
|
+
* the signature; a leader cannot replay round-1 vote bytes as round-2
|
|
96
|
+
* evidence because the round binding breaks the signature).
|
|
94
97
|
*/
|
|
95
98
|
export interface AdjudicatorVote {
|
|
96
99
|
/**
|
|
@@ -101,6 +104,13 @@ export interface AdjudicatorVote {
|
|
|
101
104
|
* fails to verify against the wrong binding).
|
|
102
105
|
*/
|
|
103
106
|
dispute_id: string;
|
|
107
|
+
/**
|
|
108
|
+
* Adjudication round. 1 for original adjudication; 2 for §8.3 appeal.
|
|
109
|
+
* Signature-bound (§6.5): a peer's round-1 vote bytes do not satisfy
|
|
110
|
+
* round-2 binding even for the same evidence. The §8.3 round-isolation
|
|
111
|
+
* property is enforced cryptographically, not by leader bookkeeping.
|
|
112
|
+
*/
|
|
113
|
+
round: number;
|
|
104
114
|
/** Federation peer MotebitId. */
|
|
105
115
|
peer_id: string;
|
|
106
116
|
/** Vote outcome. */
|
|
@@ -115,6 +125,55 @@ export interface AdjudicatorVote {
|
|
|
115
125
|
/** Ed25519 by the voting peer over canonical JSON of all fields except signature. */
|
|
116
126
|
signature: string;
|
|
117
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Federation vote request — leader-to-peer fan-out body for §6.2
|
|
130
|
+
* federation adjudication. The leader (the relay where the dispute
|
|
131
|
+
* resolution was requested AND named in the dispute as filer or
|
|
132
|
+
* respondent) POSTs this to each active federation peer; each peer
|
|
133
|
+
* returns a signed `AdjudicatorVote`.
|
|
134
|
+
*
|
|
135
|
+
* Wire-format protocol type for `relay-federation@1.2` §16. The
|
|
136
|
+
* peer-side gate ladder (`spec/relay-federation-v1.md` §16.2) enforces:
|
|
137
|
+
* schema → known peer → requester-id binding → signature → freshness
|
|
138
|
+
* → operator policy configured.
|
|
139
|
+
*
|
|
140
|
+
* Foundation Law (`spec/dispute-v1.md` §6.5):
|
|
141
|
+
* - Signature MUST cover `dispute_id`, `round`, `requester_id`, and the
|
|
142
|
+
* evidence bundle. Cross-round replay and request-tampering both
|
|
143
|
+
* fail-closed.
|
|
144
|
+
* - For round=2 (appeal), `evidence_bundle` MUST carry the original
|
|
145
|
+
* round-1 evidence plus any new evidence introduced with the appeal
|
|
146
|
+
* (per §8.4).
|
|
147
|
+
*/
|
|
148
|
+
export interface VoteRequest {
|
|
149
|
+
/** The dispute being adjudicated. MUST equal the URL `:disputeId` parameter. */
|
|
150
|
+
dispute_id: string;
|
|
151
|
+
/**
|
|
152
|
+
* Adjudication round. 1 for original adjudication; 2 for §8.3 appeal.
|
|
153
|
+
* Signature-bound — cross-round vote replay is cryptographically
|
|
154
|
+
* rejected.
|
|
155
|
+
*/
|
|
156
|
+
round: number;
|
|
157
|
+
/** Original signed dispute artifact (§4.2). The peer can re-verify the dispute's provenance from this alone. */
|
|
158
|
+
dispute_request: DisputeRequest;
|
|
159
|
+
/**
|
|
160
|
+
* All evidence collected during the dispute's evidence window (§5.2).
|
|
161
|
+
* For round=2, MUST carry the original round-1 evidence plus any new
|
|
162
|
+
* evidence introduced with the appeal.
|
|
163
|
+
*/
|
|
164
|
+
evidence_bundle: DisputeEvidence[];
|
|
165
|
+
/** Leader relay's `motebit_id`. MUST be a known peer to the receiver (gate 2). */
|
|
166
|
+
requester_id: string;
|
|
167
|
+
/** Unix ms when the leader signed. Used by gate 5 freshness check (default ±60s). */
|
|
168
|
+
requested_at: number;
|
|
169
|
+
/**
|
|
170
|
+
* Cryptosuite discriminator. Always `"motebit-jcs-ed25519-b64-v1"`
|
|
171
|
+
* (see DisputeRequest for the full recipe).
|
|
172
|
+
*/
|
|
173
|
+
suite: "motebit-jcs-ed25519-b64-v1";
|
|
174
|
+
/** Base64url Ed25519 by the leader over `canonicalJson(body minus signature)`. */
|
|
175
|
+
signature: string;
|
|
176
|
+
}
|
|
118
177
|
/**
|
|
119
178
|
* Dispute resolution by adjudicator.
|
|
120
179
|
*
|
|
@@ -173,4 +232,91 @@ export interface DisputeAppeal {
|
|
|
173
232
|
/** Ed25519 over canonical JSON of all fields except signature. */
|
|
174
233
|
signature: string;
|
|
175
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Evidence shape #1: disputant proves their peer pubkey is committed
|
|
237
|
+
* in the cert's `federation_graph_anchor.merkle_root` via an inclusion
|
|
238
|
+
* proof, but `witnessed_by[]` does not include them.
|
|
239
|
+
*
|
|
240
|
+
* Verifier in `@motebit/crypto` recomputes the proof against the cert's
|
|
241
|
+
* anchor root and asserts the leaf hash matches the canonical
|
|
242
|
+
* leaf-of-disputant-pubkey encoding (same hashing recipe as
|
|
243
|
+
* `relay-federation-v1.md` §7.6 / `credential-anchor-v1.md` §3).
|
|
244
|
+
*/
|
|
245
|
+
export interface WitnessOmissionInclusionProofEvidence {
|
|
246
|
+
kind: "inclusion_proof";
|
|
247
|
+
/**
|
|
248
|
+
* Hex-encoded SHA-256 leaf hash for the disputant's federation pubkey
|
|
249
|
+
* under the anchor's canonicalization (lowercase hex pubkey bytes).
|
|
250
|
+
*/
|
|
251
|
+
leaf_hash: string;
|
|
252
|
+
/** Inclusion proof against `cert.federation_graph_anchor.merkle_root`. */
|
|
253
|
+
proof: MerkleInclusionProof;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Evidence shape #2: disputant claims a peering relationship at
|
|
257
|
+
* `cert.horizon_ts` outside the cert's published anchor — i.e., the
|
|
258
|
+
* issuer published an incomplete or wrong anchor that omitted a peer
|
|
259
|
+
* who was peered with them at the horizon.
|
|
260
|
+
*
|
|
261
|
+
* The disputant supplies a signed peering artifact issued by the cert's
|
|
262
|
+
* issuer (e.g., a relay-federation PeeringConfirm or Heartbeat) whose
|
|
263
|
+
* timestamp window covers `cert.horizon_ts`. The verifier in
|
|
264
|
+
* `@motebit/crypto` asserts the embedded signature validates against
|
|
265
|
+
* the cert issuer's pubkey and the artifact's window covers
|
|
266
|
+
* `cert.horizon_ts`. Wire format of `peering_artifact` is opaque at this
|
|
267
|
+
* layer; verification dispatches on the artifact's own kind/spec.
|
|
268
|
+
*/
|
|
269
|
+
export interface WitnessOmissionAlternativePeeringEvidence {
|
|
270
|
+
kind: "alternative_peering";
|
|
271
|
+
/**
|
|
272
|
+
* Signed peering artifact from the cert issuer — embeds its own
|
|
273
|
+
* signature. Carries enough fields for the verifier to re-check
|
|
274
|
+
* the issuer's signature and the peering window.
|
|
275
|
+
*/
|
|
276
|
+
peering_artifact: Record<string, unknown>;
|
|
277
|
+
}
|
|
278
|
+
/** Discriminated evidence union — exactly one shape per dispute. */
|
|
279
|
+
export type WitnessOmissionEvidence = WitnessOmissionInclusionProofEvidence | WitnessOmissionAlternativePeeringEvidence;
|
|
280
|
+
/**
|
|
281
|
+
* Witness-omission dispute — files within 24h of `cert.issued_at`
|
|
282
|
+
* (`WITNESS_OMISSION_DISPUTE_WINDOW_MS` in `@motebit/crypto`) by a peer
|
|
283
|
+
* claiming the disputed cert's `witnessed_by[]` wrongly omits them.
|
|
284
|
+
*
|
|
285
|
+
* Foundation Law (Phase 4b-3 §4.4):
|
|
286
|
+
* - `cert_issuer` + `cert_signature` together pin the disputed cert —
|
|
287
|
+
* the relay reconciles the dispute against the cert in its local
|
|
288
|
+
* `relay_horizon_certs` table at validation time.
|
|
289
|
+
* - At least one evidence shape is required at filing time — either
|
|
290
|
+
* `inclusion_proof` (membership in the published anchor) or
|
|
291
|
+
* `alternative_peering` (peering attested outside the anchor).
|
|
292
|
+
* - The cert's `issued_at` is the lookup-derived clock for the 24h
|
|
293
|
+
* window — disputant-attested timestamps cannot widen the window.
|
|
294
|
+
* - Sustained disputes are reputation signals; the cert remains
|
|
295
|
+
* terminal (retention-policy.md decision 5).
|
|
296
|
+
*/
|
|
297
|
+
export interface WitnessOmissionDispute {
|
|
298
|
+
/** UUID v7, generated by the disputant. */
|
|
299
|
+
dispute_id: string;
|
|
300
|
+
/** MotebitId / operator-id of the cert issuer — the relay that signed the disputed horizon cert. */
|
|
301
|
+
cert_issuer: string;
|
|
302
|
+
/**
|
|
303
|
+
* Hex-encoded signature of the disputed `append_only_horizon` cert.
|
|
304
|
+
* Opaque pointer; the relay resolves the cert from its local
|
|
305
|
+
* `relay_horizon_certs` table.
|
|
306
|
+
*/
|
|
307
|
+
cert_signature: string;
|
|
308
|
+
/** MotebitId of the disputant peer claiming wrongful omission. */
|
|
309
|
+
disputant_motebit_id: string;
|
|
310
|
+
/** Exactly one of the two evidence shapes. */
|
|
311
|
+
evidence: WitnessOmissionEvidence;
|
|
312
|
+
/** Unix ms. */
|
|
313
|
+
filed_at: number;
|
|
314
|
+
/**
|
|
315
|
+
* Cryptosuite discriminator. Always `"motebit-jcs-ed25519-b64-v1"`
|
|
316
|
+
* (see DisputeRequest for the full recipe).
|
|
317
|
+
*/
|
|
318
|
+
suite: "motebit-jcs-ed25519-b64-v1";
|
|
319
|
+
/** Ed25519 by disputant over canonical JSON of all fields except signature. */
|
|
320
|
+
signature: string;
|
|
321
|
+
}
|
|
176
322
|
//# sourceMappingURL=dispute.d.ts.map
|
package/dist/dispute.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispute.d.ts","sourceRoot":"","sources":["../src/dispute.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"dispute.d.ts","sourceRoot":"","sources":["../src/dispute.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -85,6 +85,53 @@ export interface AgentTrustRecord {
|
|
|
85
85
|
avg_quality?: number;
|
|
86
86
|
/** Number of quality samples collected. */
|
|
87
87
|
quality_sample_count?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Most-recent verified hardware-attestation snapshot about the remote
|
|
90
|
+
* agent. Projected from the latest peer-issued `AgentTrustCredential`
|
|
91
|
+
* in the credential store at read time — never persisted on
|
|
92
|
+
* `agent_trust`. The credential is the authoritative source; caching
|
|
93
|
+
* the claim on the trust row would invite drift on revocation /
|
|
94
|
+
* re-attestation. Absent when no credential carries a claim.
|
|
95
|
+
*
|
|
96
|
+
* Shape mirrors `AgentHardwareAttestation` in `@motebit/panels` so
|
|
97
|
+
* surfaces can pass `AgentTrustRecord[]` straight to the Agents-panel
|
|
98
|
+
* adapter without per-field transformation. `score` is computed once
|
|
99
|
+
* at projection time via `scoreAttestation`
|
|
100
|
+
* (`packages/semiring/src/hardware-attestation.ts`) — keep both shapes
|
|
101
|
+
* byte-aligned. The same data flows into `HardwareAttestationSemiring`
|
|
102
|
+
* for routing — see `docs/doctrine/self-attesting-system.md`: a
|
|
103
|
+
* routing-input claim MUST be visible to the user.
|
|
104
|
+
*/
|
|
105
|
+
hardware_attestation?: {
|
|
106
|
+
platform: HardwareAttestationClaim["platform"];
|
|
107
|
+
key_exported?: boolean;
|
|
108
|
+
score: number;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Most-recent observed-latency snapshot for delegations to this peer.
|
|
112
|
+
* Projected from the local `LatencyStatsStore` at read time — never
|
|
113
|
+
* persisted on `agent_trust`. The store is the authoritative source;
|
|
114
|
+
* caching avg/p95 on the trust row would invite drift on every new
|
|
115
|
+
* task. Absent when the store has zero samples for this pair.
|
|
116
|
+
*
|
|
117
|
+
* Same surface contract as `hardware_attestation`: every routing-input
|
|
118
|
+
* the runtime computes against MUST be visible to the user, per
|
|
119
|
+
* `docs/doctrine/self-attesting-system.md`. Latency factors into peer
|
|
120
|
+
* ranking through `agent-graph.ts`'s latency map (default 3000ms when
|
|
121
|
+
* stats are absent); the Agents-panel latency render is the user-facing
|
|
122
|
+
* surface for that input.
|
|
123
|
+
*
|
|
124
|
+
* Shape mirrors `AgentLatencyStats` in `@motebit/panels` so surfaces
|
|
125
|
+
* can pass `AgentTrustRecord[]` straight to the Agents-panel adapter
|
|
126
|
+
* without per-field transformation. Numbers in milliseconds; integer
|
|
127
|
+
* sample counts. The relay-side enricher uses the same shape from its
|
|
128
|
+
* `relay_latency_stats` table.
|
|
129
|
+
*/
|
|
130
|
+
latency_stats?: {
|
|
131
|
+
avg_ms: number;
|
|
132
|
+
p95_ms: number;
|
|
133
|
+
sample_count: number;
|
|
134
|
+
};
|
|
88
135
|
}
|
|
89
136
|
/** Thresholds for automatic trust level promotion/demotion. */
|
|
90
137
|
export interface TrustTransitionThresholds {
|
|
@@ -200,7 +247,12 @@ export declare enum EventType {
|
|
|
200
247
|
TrustLevelChanged = "trust_level_changed",
|
|
201
248
|
KeyRotated = "key_rotated",
|
|
202
249
|
ComputerSessionOpened = "computer_session_opened",
|
|
203
|
-
ComputerSessionClosed = "computer_session_closed"
|
|
250
|
+
ComputerSessionClosed = "computer_session_closed",
|
|
251
|
+
ComputerSessionSummarized = "computer_session_summarized",
|
|
252
|
+
CoBrowseControlChanged = "co_browse_control_changed",
|
|
253
|
+
UserInputForwarded = "user_input_forwarded",
|
|
254
|
+
SkillLoaded = "skill_loaded",
|
|
255
|
+
SensitivityGateFired = "sensitivity_gate_fired"
|
|
204
256
|
}
|
|
205
257
|
export declare enum MemoryType {
|
|
206
258
|
Episodic = "episodic",
|
|
@@ -321,6 +373,16 @@ export interface ToolAuditEntry {
|
|
|
321
373
|
injection?: InjectionWarning;
|
|
322
374
|
costUnits?: number;
|
|
323
375
|
timestamp: number;
|
|
376
|
+
/**
|
|
377
|
+
* Sensitivity tier classified at write time. Optional in v1: pre-
|
|
378
|
+
* phase-5 entries drop the field, and the consolidation-cycle flush
|
|
379
|
+
* phase lazy-classifies on read per docs/doctrine/retention-policy.md
|
|
380
|
+
* §"Decision 6b". Tool-audit entries also carry an obligation floor
|
|
381
|
+
* resolved per record (settlement window, dispute window, regulatory
|
|
382
|
+
* floor); the cycle's flush phase computes
|
|
383
|
+
* `max(sensitivity_floor, obligation_floor)` per decision 3.
|
|
384
|
+
*/
|
|
385
|
+
sensitivity?: SensitivityLevel;
|
|
324
386
|
}
|
|
325
387
|
export interface ToolDefinition {
|
|
326
388
|
name: string;
|
|
@@ -340,11 +402,103 @@ export interface ToolDefinition {
|
|
|
340
402
|
* last. See `@motebit/protocol/tool-mode`.
|
|
341
403
|
*/
|
|
342
404
|
mode?: ToolMode;
|
|
405
|
+
/**
|
|
406
|
+
* Outbound axis — true when execution sends bytes outside the device
|
|
407
|
+
* (HTTP fetch, search-engine query, MCP server call,
|
|
408
|
+
* cross-motebit delegation). Independent of `riskHint` (which
|
|
409
|
+
* captures local risk: file overwrite, irreversible side effect).
|
|
410
|
+
*
|
|
411
|
+
* Consumed by the runtime's sensitivity-routing gate: an outbound
|
|
412
|
+
* tool refuses to execute when session sensitivity is
|
|
413
|
+
* medical/financial/secret AND the configured provider is not
|
|
414
|
+
* sovereign — the same fail-closed contract that gates AI provider
|
|
415
|
+
* calls (CLAUDE.md privacy doctrine: "Medical/financial/secret never
|
|
416
|
+
* reach external AI"; the principle generalizes to any outbound
|
|
417
|
+
* surface). Default `false`/absent ≡ local — matches the
|
|
418
|
+
* pre-existing builtin set (read_file, recall_memories, current_time).
|
|
419
|
+
*
|
|
420
|
+
* Tools added through `@motebit/mcp-client` always set this to
|
|
421
|
+
* `true` (MCP tools execute against a remote server by definition).
|
|
422
|
+
* See `check-tool-modes` for the cost-tier sibling and
|
|
423
|
+
* `check-sensitivity-routing` for the outbound enforcement gate.
|
|
424
|
+
*/
|
|
425
|
+
outbound?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* Embodiment mode the slab item should stamp when this tool's
|
|
428
|
+
* activity lands on the slab. One of: `"mind"` | `"tool_result"` |
|
|
429
|
+
* `"virtual_browser"` | `"shared_gaze"` | `"desktop_drive"` |
|
|
430
|
+
* `"peer_viewport"`. The string union is canonically declared as
|
|
431
|
+
* `EmbodimentMode` in `@motebit/render-engine` (typed as `string`
|
|
432
|
+
* here to avoid the protocol→render-engine layer break — promoting
|
|
433
|
+
* the type into `@motebit/protocol` is a separate slice the doctrine
|
|
434
|
+
* names as deferred).
|
|
435
|
+
*
|
|
436
|
+
* Why this lives on the tool definition (not on each chunk): the
|
|
437
|
+
* embodiment is determined at registration time by the surface
|
|
438
|
+
* wiring the dispatcher. The `computer` tool's wire format is
|
|
439
|
+
* surface-agnostic but its embodiment is dispatcher-specific:
|
|
440
|
+
* `apps/web/src/computer-tool.ts` registers it with
|
|
441
|
+
* `embodimentMode: "virtual_browser"` (cloud Chromium); the desktop
|
|
442
|
+
* surface registers the same name with `embodimentMode:
|
|
443
|
+
* "desktop_drive"` (real OS). The runtime's slab-projection picks
|
|
444
|
+
* `chunk.mode` (sourced from this field) over `tool-policy.ts`'s
|
|
445
|
+
* generic floor — so the same tool name produces the right
|
|
446
|
+
* embodiment per surface without forcing surface-aware code into
|
|
447
|
+
* the central registry. Doctrine: motebit-computer.md §"v1
|
|
448
|
+
* implementation status — Deferred to v1.5+: per-dispatcher mode
|
|
449
|
+
* stamping" — landed as v1.1 of the virtual_browser arc.
|
|
450
|
+
*/
|
|
451
|
+
embodimentMode?: string;
|
|
452
|
+
/**
|
|
453
|
+
* Slab-projection policy for this tool. Closed string-literal union:
|
|
454
|
+
*
|
|
455
|
+
* - `"tool_call"` (default when omitted) — open a generic
|
|
456
|
+
* `tool_call` slab item on each invocation. The familiar
|
|
457
|
+
* "REQUEST_X / calling…" card. Right for tools that produce
|
|
458
|
+
* body acts (web_search, read_file, computer).
|
|
459
|
+
* - `"none"` — do NOT open a slab item. The tool is **state
|
|
460
|
+
* chrome**, not a body act, and its visible representation is
|
|
461
|
+
* a different surface (e.g. `request_control`'s visible
|
|
462
|
+
* surface is the slab control band, not a tool_call card).
|
|
463
|
+
* Without this, state-chrome tools would render duplicate UI:
|
|
464
|
+
* the affordance card AND the chrome both visible, competing
|
|
465
|
+
* for attention and obscuring the band's Grant/Deny buttons.
|
|
466
|
+
*
|
|
467
|
+
* Doctrine: motebit-computer.md — slab content is body acts
|
|
468
|
+
* (browser, peer viewport, memory artifact, tool result, desktop
|
|
469
|
+
* surface). Slab CHROME is state-aware overlays (control band,
|
|
470
|
+
* address bar, halt indicator). State-chrome tools belong in the
|
|
471
|
+
* latter; the slab item projection is for the former.
|
|
472
|
+
*
|
|
473
|
+
* Plumbing: read on the tool_status chunk by ai-core's loop.ts
|
|
474
|
+
* and consumed by the runtime's slab-projection at open time.
|
|
475
|
+
* The closed-string-literal union keeps additions backward
|
|
476
|
+
* compatible (a future `"observation"` variant could narrow
|
|
477
|
+
* further without breaking existing consumers).
|
|
478
|
+
*/
|
|
479
|
+
slabProjection?: "none" | "tool_call";
|
|
343
480
|
}
|
|
344
481
|
export interface ToolResult {
|
|
345
482
|
ok: boolean;
|
|
346
483
|
data?: unknown;
|
|
347
484
|
error?: string;
|
|
485
|
+
/**
|
|
486
|
+
* Optional structured failure category, set by handlers that wrap
|
|
487
|
+
* a typed error carrying its own `reason` field (e.g.
|
|
488
|
+
* `ComputerDispatcherError`). Lets downstream consumers route on
|
|
489
|
+
* category without parsing the human-readable `error` text.
|
|
490
|
+
*
|
|
491
|
+
* v1 carriers:
|
|
492
|
+
* - `not_in_control` — Slice 1 co-browse gate denial. The
|
|
493
|
+
* runtime's slab projection uses this to suppress a body
|
|
494
|
+
* `tool_call` item: control-state denials' canonical surface
|
|
495
|
+
* is the slab control band (Slice 2b doorbell), not the body.
|
|
496
|
+
*
|
|
497
|
+
* Open string-literal — additive. New reason categories land
|
|
498
|
+
* without breaking existing callers (consumers either route on
|
|
499
|
+
* the value they care about or ignore the field).
|
|
500
|
+
*/
|
|
501
|
+
reason?: string;
|
|
348
502
|
/** Set by adapters that already applied boundary wrapping (e.g. MCP client). */
|
|
349
503
|
_sanitized?: boolean;
|
|
350
504
|
}
|
|
@@ -398,6 +552,14 @@ export interface SyncConversationMessage {
|
|
|
398
552
|
tool_call_id: string | null;
|
|
399
553
|
created_at: number;
|
|
400
554
|
token_estimate: number;
|
|
555
|
+
/**
|
|
556
|
+
* Sensitivity tier classified at write time. Optional in v1: peers
|
|
557
|
+
* running pre-phase-5 builds drop the field on push, and the receiver
|
|
558
|
+
* lazy-classifies on flush per docs/doctrine/retention-policy.md
|
|
559
|
+
* §"Decision 6b" using the operator's
|
|
560
|
+
* `pre_classification_default_sensitivity`.
|
|
561
|
+
*/
|
|
562
|
+
sensitivity?: import("./retention-policy.js").SensitivityLevelString;
|
|
401
563
|
}
|
|
402
564
|
/** Result of a conversation sync cycle. */
|
|
403
565
|
export interface ConversationSyncResult {
|
|
@@ -721,10 +883,10 @@ export interface ConsolidationReceipt {
|
|
|
721
883
|
finished_at: number;
|
|
722
884
|
/** Phases that ran to completion. Closed union — adding a phase is a
|
|
723
885
|
* protocol-coordinated change. */
|
|
724
|
-
phases_run: ReadonlyArray<"orient" | "gather" | "consolidate" | "prune">;
|
|
886
|
+
phases_run: ReadonlyArray<"orient" | "gather" | "consolidate" | "prune" | "flush">;
|
|
725
887
|
/** Phases that yielded mid-execution because their AbortSignal fired
|
|
726
888
|
* (budget exhausted or parent signal aborted). Subset of `phases_run`. */
|
|
727
|
-
phases_yielded: ReadonlyArray<"orient" | "gather" | "consolidate" | "prune">;
|
|
889
|
+
phases_yielded: ReadonlyArray<"orient" | "gather" | "consolidate" | "prune" | "flush">;
|
|
728
890
|
/** Structural counts only — never memory content. The privacy boundary
|
|
729
891
|
* is the type: there is no field here that could leak a memory's text
|
|
730
892
|
* or embedding. Adding such a field is a protocol break. */
|
|
@@ -736,6 +898,10 @@ export interface ConsolidationReceipt {
|
|
|
736
898
|
pruned_decay?: number;
|
|
737
899
|
pruned_notability?: number;
|
|
738
900
|
pruned_retention?: number;
|
|
901
|
+
/** Conversation messages flushed under `consolidation_flush` (phase 5-ship). */
|
|
902
|
+
flushed_conversations?: number;
|
|
903
|
+
/** Tool-audit entries flushed under `consolidation_flush` (phase 5-ship). */
|
|
904
|
+
flushed_tool_audits?: number;
|
|
739
905
|
};
|
|
740
906
|
/**
|
|
741
907
|
* Cryptosuite discriminator. Always `"motebit-jcs-ed25519-b64-v1"` for
|
|
@@ -1073,7 +1239,13 @@ export interface ExecutionStepSummary {
|
|
|
1073
1239
|
};
|
|
1074
1240
|
}
|
|
1075
1241
|
export interface GoalExecutionManifest {
|
|
1076
|
-
|
|
1242
|
+
/**
|
|
1243
|
+
* `motebit/execution-ledger@1.0` for legacy ledgers, `motebit/execution-ledger@1.1`
|
|
1244
|
+
* for ledgers that embed byte-identical inner signed receipts via `signed_receipts`.
|
|
1245
|
+
* v1.1 is purely additive — every v1.0 consumer continues to parse v1.1 bodies
|
|
1246
|
+
* by ignoring the optional field. See `spec/execution-ledger-v1.md` §4.3.
|
|
1247
|
+
*/
|
|
1248
|
+
spec: "motebit/execution-ledger@1.0" | "motebit/execution-ledger@1.1";
|
|
1077
1249
|
motebit_id: string;
|
|
1078
1250
|
goal_id: string;
|
|
1079
1251
|
plan_id: string;
|
|
@@ -1083,6 +1255,19 @@ export interface GoalExecutionManifest {
|
|
|
1083
1255
|
timeline: ExecutionTimelineEntry[];
|
|
1084
1256
|
steps: ExecutionStepSummary[];
|
|
1085
1257
|
delegation_receipts: DelegationReceiptSummary[];
|
|
1258
|
+
/**
|
|
1259
|
+
* Byte-identical canonical-JSON of each delegated motebit's signed
|
|
1260
|
+
* `ExecutionReceipt`. Optional and only present in v1.1 reconstructions
|
|
1261
|
+
* where the relay has the receipts archived (per
|
|
1262
|
+
* `services/relay/CLAUDE.md` Rule 11). Each element is the JSON-stringified
|
|
1263
|
+
* receipt the motebit signed; verifiers MAY parse + recursively verify
|
|
1264
|
+
* each one's Ed25519 signature independently. Closes the operator-trust
|
|
1265
|
+
* gap that v1.0 summaries leave open — a relay that lies about which
|
|
1266
|
+
* motebit did the work is detectable because the inner signature can be
|
|
1267
|
+
* checked against the named motebit's public key without trusting the
|
|
1268
|
+
* relay. See `spec/execution-ledger-v1.md` §4.3.
|
|
1269
|
+
*/
|
|
1270
|
+
signed_receipts?: string[];
|
|
1086
1271
|
content_hash: string;
|
|
1087
1272
|
signature?: string;
|
|
1088
1273
|
}
|
|
@@ -1095,6 +1280,14 @@ export interface DelegationReceiptSummary {
|
|
|
1095
1280
|
tools_used: string[];
|
|
1096
1281
|
signature_prefix: string;
|
|
1097
1282
|
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Canonical spec identifiers for the execution-ledger reconstruction.
|
|
1285
|
+
* v1.1 adds the optional `signed_receipts` field; the wire shape is
|
|
1286
|
+
* otherwise identical to v1.0. Verifiers that recognize v1.1 SHOULD
|
|
1287
|
+
* iterate `signed_receipts` and verify each inner signature when present.
|
|
1288
|
+
*/
|
|
1289
|
+
export declare const EXECUTION_LEDGER_SPEC_V1_0: "motebit/execution-ledger@1.0";
|
|
1290
|
+
export declare const EXECUTION_LEDGER_SPEC_V1_1: "motebit/execution-ledger@1.1";
|
|
1098
1291
|
export interface AgentCapabilities {
|
|
1099
1292
|
motebit_id: MotebitId;
|
|
1100
1293
|
public_key: string;
|
|
@@ -1168,7 +1361,7 @@ export declare const PLATFORM_FEE_RATE = 0.05;
|
|
|
1168
1361
|
/**
|
|
1169
1362
|
* Per-task settlement bookkeeping artifact.
|
|
1170
1363
|
*
|
|
1171
|
-
* Foundation Law (services/
|
|
1364
|
+
* Foundation Law (services/relay/CLAUDE.md rule 6):
|
|
1172
1365
|
* - Every truth the relay asserts (credential anchor proofs,
|
|
1173
1366
|
* revocation memos, settlement receipts) is independently
|
|
1174
1367
|
* verifiable onchain without relay contact.
|
|
@@ -1578,6 +1771,15 @@ export interface ConversationStoreAdapter {
|
|
|
1578
1771
|
content: string;
|
|
1579
1772
|
toolCalls?: string;
|
|
1580
1773
|
toolCallId?: string;
|
|
1774
|
+
/**
|
|
1775
|
+
* Sensitivity tier the message was classified at on write.
|
|
1776
|
+
* Optional in v1: pre-classification messages and adapters that
|
|
1777
|
+
* haven't yet been migrated to the phase-5-ship column drop the
|
|
1778
|
+
* field, and the consolidation-cycle flush phase lazy-classifies
|
|
1779
|
+
* on read per docs/doctrine/retention-policy.md §"Decision 6b"
|
|
1780
|
+
* (operator manifest's `pre_classification_default_sensitivity`).
|
|
1781
|
+
*/
|
|
1782
|
+
sensitivity?: SensitivityLevel;
|
|
1581
1783
|
}): void;
|
|
1582
1784
|
loadMessages(conversationId: string, limit?: number): Array<{
|
|
1583
1785
|
messageId: string;
|
|
@@ -1589,6 +1791,7 @@ export interface ConversationStoreAdapter {
|
|
|
1589
1791
|
toolCallId: string | null;
|
|
1590
1792
|
createdAt: number;
|
|
1591
1793
|
tokenEstimate: number;
|
|
1794
|
+
sensitivity?: SensitivityLevel;
|
|
1592
1795
|
}>;
|
|
1593
1796
|
getActiveConversation(motebitId: string): {
|
|
1594
1797
|
conversationId: string;
|
|
@@ -1606,6 +1809,28 @@ export interface ConversationStoreAdapter {
|
|
|
1606
1809
|
messageCount: number;
|
|
1607
1810
|
}>;
|
|
1608
1811
|
deleteConversation(conversationId: string): void;
|
|
1812
|
+
/**
|
|
1813
|
+
* Enumerate messages older than `beforeCreatedAt`. The
|
|
1814
|
+
* consolidation-cycle flush phase calls this per
|
|
1815
|
+
* docs/doctrine/retention-policy.md §"Consolidation flush" to find
|
|
1816
|
+
* candidates whose retention floor may have passed. Optional — when
|
|
1817
|
+
* absent, the flush phase is a no-op for this store on this surface.
|
|
1818
|
+
*/
|
|
1819
|
+
enumerateForFlush?(motebitId: string, beforeCreatedAt: number): Array<{
|
|
1820
|
+
messageId: string;
|
|
1821
|
+
conversationId: string;
|
|
1822
|
+
role: string;
|
|
1823
|
+
content: string;
|
|
1824
|
+
createdAt: number;
|
|
1825
|
+
sensitivity?: SensitivityLevel;
|
|
1826
|
+
}>;
|
|
1827
|
+
/**
|
|
1828
|
+
* Erase a single message row — physical row removal, the storage
|
|
1829
|
+
* operation behind a `consolidation_flush` deletion certificate per
|
|
1830
|
+
* decision 7. Distinct from `deleteConversation` (whole-conversation
|
|
1831
|
+
* tombstone). Optional — paired with `enumerateForFlush`.
|
|
1832
|
+
*/
|
|
1833
|
+
eraseMessage?(messageId: string): void;
|
|
1609
1834
|
}
|
|
1610
1835
|
export interface StateSnapshotAdapter {
|
|
1611
1836
|
saveState(motebitId: string, stateJson: string, versionClock?: number): void;
|
|
@@ -1670,6 +1895,19 @@ export interface EventStoreAdapter {
|
|
|
1670
1895
|
tombstone(eventId: string, motebitId: string): Promise<void>;
|
|
1671
1896
|
/** Delete events with version_clock <= beforeClock. Returns count deleted. */
|
|
1672
1897
|
compact?(motebitId: string, beforeClock: number): Promise<number>;
|
|
1898
|
+
/**
|
|
1899
|
+
* Erase events with `timestamp < horizonTs`. Returns count erased.
|
|
1900
|
+
* Distinct from `compact` (state-snapshot driven, version-clock-keyed):
|
|
1901
|
+
* `truncateBeforeHorizon` is the storage operation behind an
|
|
1902
|
+
* `append_only_horizon` deletion certificate per
|
|
1903
|
+
* docs/doctrine/retention-policy.md §"Decision 4". Whole-prefix
|
|
1904
|
+
* truncation only — entries before `horizonTs` are unrecoverable.
|
|
1905
|
+
*
|
|
1906
|
+
* Optional in phase 4a (local-only horizon advance ships first).
|
|
1907
|
+
* Phase 4b tightens to required once federation co-witness lands and
|
|
1908
|
+
* every operator's event log is expected to support horizon advance.
|
|
1909
|
+
*/
|
|
1910
|
+
truncateBeforeHorizon?(motebitId: string, horizonTs: number): Promise<number>;
|
|
1673
1911
|
/** Count total events for a motebit. */
|
|
1674
1912
|
countEvents?(motebitId: string): Promise<number>;
|
|
1675
1913
|
}
|
|
@@ -1715,6 +1953,41 @@ export interface AuditStatsSince {
|
|
|
1715
1953
|
blocked: number;
|
|
1716
1954
|
failed: number;
|
|
1717
1955
|
}
|
|
1956
|
+
/**
|
|
1957
|
+
* audit-chain — single entry in the hash-linked tamper-evident
|
|
1958
|
+
* audit trail. Each entry's `hash` is `SHA-256(canonical({
|
|
1959
|
+
* previous_hash, entry_id, timestamp, event_type, actor_id, data
|
|
1960
|
+
* }))`; `previous_hash` references the prior entry's `hash` (or
|
|
1961
|
+
* `"genesis"` for the first entry). The runtime computes hashes on
|
|
1962
|
+
* append; verifiers recompute and compare.
|
|
1963
|
+
*
|
|
1964
|
+
* Lives in protocol (permissive-floor wire-format type) so
|
|
1965
|
+
* `StorageAdapters.auditChainStore` can reference it without sdk
|
|
1966
|
+
* importing the BSL `@motebit/policy` package. The concrete
|
|
1967
|
+
* primitives (`appendAuditEntry`, `verifyAuditChain`, the
|
|
1968
|
+
* `crypto.subtle` hashing) live in `@motebit/policy`'s
|
|
1969
|
+
* `audit-chain.ts` — that's where the algorithm runs.
|
|
1970
|
+
*/
|
|
1971
|
+
export interface AuditChainEntry {
|
|
1972
|
+
readonly entry_id: string;
|
|
1973
|
+
readonly timestamp: number;
|
|
1974
|
+
readonly event_type: string;
|
|
1975
|
+
readonly actor_id: string;
|
|
1976
|
+
readonly data: Record<string, unknown>;
|
|
1977
|
+
readonly previous_hash: string;
|
|
1978
|
+
readonly hash: string;
|
|
1979
|
+
}
|
|
1980
|
+
/**
|
|
1981
|
+
* audit-chain — minimal storage interface adapters implement.
|
|
1982
|
+
* Append-only — the chain breaks if entries are deleted or
|
|
1983
|
+
* reordered, which is the whole tamper-evidence point.
|
|
1984
|
+
*/
|
|
1985
|
+
export interface AuditChainStoreAdapter {
|
|
1986
|
+
append(entry: AuditChainEntry): Promise<void>;
|
|
1987
|
+
getEntries(from?: number, to?: number): Promise<AuditChainEntry[]>;
|
|
1988
|
+
getHead(): Promise<AuditChainEntry | undefined>;
|
|
1989
|
+
count(): Promise<number>;
|
|
1990
|
+
}
|
|
1718
1991
|
export interface AuditLogSink {
|
|
1719
1992
|
append(entry: ToolAuditEntry): void;
|
|
1720
1993
|
query(turnId: string): ToolAuditEntry[];
|
|
@@ -1722,6 +1995,20 @@ export interface AuditLogSink {
|
|
|
1722
1995
|
queryStatsSince(afterTimestamp: number): AuditStatsSince;
|
|
1723
1996
|
/** Query tool audit entries by run_id (plan execution). Optional — returns [] if not implemented. */
|
|
1724
1997
|
queryByRunId?(runId: string): ToolAuditEntry[];
|
|
1998
|
+
/**
|
|
1999
|
+
* Enumerate entries older than `beforeTimestamp`. The
|
|
2000
|
+
* consolidation-cycle flush phase calls this per
|
|
2001
|
+
* docs/doctrine/retention-policy.md §"Consolidation flush" to find
|
|
2002
|
+
* candidates whose retention floor may have passed. Optional — when
|
|
2003
|
+
* absent, the flush phase is a no-op for this store on this surface.
|
|
2004
|
+
*/
|
|
2005
|
+
enumerateForFlush?(beforeTimestamp: number): ToolAuditEntry[];
|
|
2006
|
+
/**
|
|
2007
|
+
* Erase a single tool-audit entry — physical row removal, the storage
|
|
2008
|
+
* operation behind a `consolidation_flush` deletion certificate per
|
|
2009
|
+
* decision 7. Optional — paired with `enumerateForFlush`.
|
|
2010
|
+
*/
|
|
2011
|
+
erase?(callId: string): void;
|
|
1725
2012
|
}
|
|
1726
2013
|
export interface PlanStoreAdapter {
|
|
1727
2014
|
savePlan(plan: Plan): void;
|
|
@@ -1775,16 +2062,33 @@ export type { CredentialAnchorBatch, CredentialChainAnchor, CredentialAnchorProo
|
|
|
1775
2062
|
export type { AgentSettlementAnchorBatch, AgentSettlementChainAnchor, AgentSettlementAnchorProof, } from "./agent-settlement-anchor.js";
|
|
1776
2063
|
export type { RelayMetadata, RelayMetadataPeer, AgentResolutionResult } from "./discovery.js";
|
|
1777
2064
|
export type { MigrationState, MigrationRequest, MigrationToken, DepartureAttestation, CredentialBundle, BalanceWaiver, MigrationPresentation, } from "./migration.js";
|
|
1778
|
-
export type { DisputeState, DisputeOutcome, DisputeCategory, DisputeFundAction, DisputeRequest, DisputeEvidence, DisputeEvidenceType, AdjudicatorVote, DisputeResolution, DisputeAppeal, } from "./dispute.js";
|
|
2065
|
+
export type { DisputeState, DisputeOutcome, DisputeCategory, DisputeFundAction, DisputeRequest, DisputeEvidence, DisputeEvidenceType, AdjudicatorVote, VoteRequest, DisputeResolution, DisputeAppeal, WitnessOmissionDispute, WitnessOmissionEvidence, WitnessOmissionInclusionProofEvidence, WitnessOmissionAlternativePeeringEvidence, } from "./dispute.js";
|
|
1779
2066
|
export type { SettlementMode, P2pPaymentProof, PaymentVerificationStatus, SettlementEligibility, SolvencyProof, } from "./settlement-mode.js";
|
|
1780
2067
|
export type { SuiteId, SuiteEntry, SuiteStatus, SuiteAlgorithm, SuiteCanonicalization, SuiteSignatureEncoding, SuitePublicKeyEncoding, } from "./crypto-suite.js";
|
|
1781
2068
|
export { SUITE_REGISTRY, ALL_SUITE_IDS, isSuiteId, getSuiteEntry } from "./crypto-suite.js";
|
|
2069
|
+
export { MAX_RETENTION_DAYS_BY_SENSITIVITY, REFERENCE_RETENTION_DAYS_BY_SENSITIVITY, RUNTIME_RETENTION_REGISTRY, EMPTY_FEDERATION_GRAPH_ANCHOR, } from "./retention-policy.js";
|
|
2070
|
+
export type { RetentionCeilingDays, RetentionShape, RetentionShapeDeclaration, RetentionStoreDeclaration, RetentionManifest, RuntimeStoreId, DeletionCertificate, DeletionReason, HorizonSubject, HorizonWitness, HorizonWitnessRequestBody, WitnessSolicitationRequest, WitnessSolicitationResponse, FederationGraphAnchor, MerkleAlgo, MerkleInclusionProof, SubjectSignature, OperatorSignature, DelegateSignature, GuardianSignature, SensitivityLevelString, } from "./retention-policy.js";
|
|
1782
2071
|
export type { MemoryDecayedPayload, MemoryFormedPayload, MemoryAccessedPayload, MemoryPinnedPayload, MemoryDeletedPayload, MemoryConsolidatedPayload, MemoryAuditPayload, MemoryPromotedPayload, } from "./memory-events.js";
|
|
1783
2072
|
export type { GoalCreatedPayload, GoalExecutedPayload, GoalProgressPayload, GoalCompletedPayload, GoalRemovedPayload, } from "./goal-lifecycle.js";
|
|
1784
2073
|
export type { PlanCreatedPayload, PlanStepStartedPayload, PlanStepCompletedPayload, PlanStepFailedPayload, PlanStepDelegatedPayload, PlanCompletedPayload, PlanFailedPayload, } from "./plan-lifecycle.js";
|
|
1785
|
-
export type { ComputerPoint, ComputerTargetHint, ScreenshotAction, CursorPositionAction, ClickAction, DoubleClickAction, MouseMoveAction, DragAction, TypeAction, KeyAction, ScrollAction, ComputerAction, ComputerActionKind, ComputerActionRequest, ComputerObservationResult, ComputerRedaction, ScreenshotObservation, CursorPositionObservation, ComputerSessionOpened, ComputerSessionClosed, ComputerFailureReason, } from "./computer-use.js";
|
|
2074
|
+
export type { ComputerPoint, ComputerTargetHint, ScreenshotAction, CursorPositionAction, ClickAction, DoubleClickAction, MouseMoveAction, DragAction, TypeAction, KeyAction, ScrollAction, NavigateAction, ClickElementAction, FocusElementAction, TypeIntoAction, ComputerAction, ComputerActionKind, ComputerActionRequest, ComputerObservationResult, ComputerRedaction, ScreenshotObservation, CursorPositionObservation, ReadPageResult, ReadPageHeading, ReadPageLink, ReadPageInput, ReadPageButton, ComputerSessionOpened, ComputerSessionClosed, ComputerFailureReason, ComputerSessionActionRecord, SignableComputerSessionReceipt, ComputerSessionReceipt, ScreencastFrame, ScreencastFrameSource, } from "./computer-use.js";
|
|
1786
2075
|
export { COMPUTER_ACTION_KINDS, COMPUTER_FAILURE_REASONS } from "./computer-use.js";
|
|
2076
|
+
export type { ControlHolder, ControlState, CoBrowseTransitionKind, CoBrowseControlChangedPayload, KeyModifiers, UserInputEvent, UserInputForwardOutcome, UserInputRejectionReason, CharacterClass, KeyRole, UserInputForwardedDetail, UserInputForwardedPayload, } from "./co-browse.js";
|
|
2077
|
+
export { CO_BROWSE_TRANSITION_KINDS } from "./co-browse.js";
|
|
1787
2078
|
export type { ToolMode } from "./tool-mode.js";
|
|
1788
2079
|
export { TOOL_MODES, toolModePriority } from "./tool-mode.js";
|
|
2080
|
+
export type { DropPayloadKind, DropTarget, DropPayload, UserActionAttestation, SensitivityGateEntry, SensitivityElevationSource, SensitivityGateFiredPayload, } from "./perception.js";
|
|
2081
|
+
export { resolveDropTarget } from "./perception.js";
|
|
2082
|
+
export { rankSensitivity, maxSensitivity, sensitivityPermits } from "./sensitivity.js";
|
|
2083
|
+
export { MICRO, CENTS, toMicro, fromMicro, toCents, fromCents } from "./money.js";
|
|
2084
|
+
export type { TokenAudience } from "./audience.js";
|
|
2085
|
+
export { ALL_TOKEN_AUDIENCES, isTokenAudience, SYNC_AUDIENCE, DEVICE_AUTH_AUDIENCE, PAIR_AUDIENCE, ROTATE_KEY_AUDIENCE, PUSH_REGISTER_AUDIENCE, TASK_SUBMIT_AUDIENCE, ADMIN_QUERY_AUDIENCE, PROPOSAL_AUDIENCE, ACCOUNT_BALANCE_AUDIENCE, ACCOUNT_DEPOSIT_AUDIENCE, ACCOUNT_WITHDRAW_AUDIENCE, ACCOUNT_WITHDRAWALS_AUDIENCE, ACCOUNT_CHECKOUT_AUDIENCE, BROWSER_SANDBOX_GRANT_AUDIENCE, BROWSER_SANDBOX_AUDIENCE, } from "./audience.js";
|
|
2086
|
+
export type { ContentArtifactType } from "./artifact-type.js";
|
|
2087
|
+
export { ALL_CONTENT_ARTIFACT_TYPES, isContentArtifactType, STATE_SNAPSHOT_ARTIFACT, MEMORY_EXPORT_ARTIFACT, GOAL_LIST_ARTIFACT, CONVERSATION_LIST_ARTIFACT, CONVERSATION_MESSAGES_ARTIFACT, DEVICE_LIST_ARTIFACT, AUDIT_TRAIL_ARTIFACT, PLAN_LIST_ARTIFACT, PLAN_DETAIL_ARTIFACT, GRADIENT_HISTORY_ARTIFACT, SYNC_PULL_ARTIFACT, EXECUTION_LEDGER_ARTIFACT, } from "./artifact-type.js";
|
|
2088
|
+
export type { SignedTransparencyDeclaration, TransparencySignedPayload, TransparencyAnchorRecord, } from "./transparency.js";
|
|
2089
|
+
export { TRANSPARENCY_SUITE, TRANSPARENCY_ANCHOR_MEMO_PREFIX, TRANSPARENCY_SPEC_ID, isSignedTransparencyDeclaration, } from "./transparency.js";
|
|
1789
2090
|
import type { ToolMode } from "./tool-mode.js";
|
|
2091
|
+
export type { SkillSensitivity, SkillPlatform, SkillHardwareAttestationGate, SkillSignature, SkillManifestMetadata, SkillManifestMotebit, SkillManifest, SkillEnvelopeFile, SkillEnvelopeSkillRef, SkillEnvelope, SkillLoadPayload, } from "./skills.js";
|
|
2092
|
+
export { SKILL_SENSITIVITY_TIERS, SKILL_AUTO_LOADABLE_TIERS, SKILL_PLATFORMS } from "./skills.js";
|
|
2093
|
+
export type { SkillRegistryEntry, SkillRegistrySubmitRequest, SkillRegistrySubmitResponse, SkillRegistryListing, SkillRegistryBundle, } from "./skills.js";
|
|
1790
2094
|
//# sourceMappingURL=index.d.ts.map
|