@exponential_app/engine 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/capabilities.js +1 -1
- package/dist/chunks/{index-ax4aay30.js → index-3nf9f7pv.js} +2 -2
- package/dist/chunks/{index-ans80t68.js → index-3rgr16n2.js} +67 -6
- package/dist/chunks/{index-e49v2qpf.js.map → index-3rgr16n2.js.map} +1 -1
- package/dist/chunks/{index-n0acffvs.js → index-79swfbsm.js} +3 -3
- package/dist/chunks/{index-nrr8x2kq.js → index-knntt4cb.js} +2 -2
- package/dist/chunks/{index-e49v2qpf.js → index-pqpnz4ns.js} +38 -2
- package/dist/chunks/{index-ans80t68.js.map → index-pqpnz4ns.js.map} +1 -1
- package/dist/chunks/{index-t89cvabm.js → index-q4zws02e.js} +2 -2
- package/dist/chunks/{index-zw0575tv.js → index-sk8b0dh4.js} +4 -4
- package/dist/chunks/{index-zw0575tv.js.map → index-sk8b0dh4.js.map} +1 -1
- package/dist/chunks/{index-md3hz6r2.js → index-tvsykgcv.js} +3 -3
- package/dist/chunks/{index-md3hz6r2.js.map → index-tvsykgcv.js.map} +2 -2
- package/dist/chunks/{index-4ntgtkmb.js → index-v0m7r4y3.js} +90 -4
- package/dist/chunks/{index-4ntgtkmb.js.map → index-v0m7r4y3.js.map} +3 -3
- package/dist/consent.js +2 -2
- package/dist/index.js +136 -8
- package/dist/index.js.map +5 -4
- package/dist/outbox.js +1 -1
- package/dist/pdf.js +1 -1
- package/dist/providers.js +2 -2
- package/dist/runner.js +2 -2
- package/dist/tools.js +2 -2
- package/dist/types/domain-contract/src/apps.d.ts +18 -0
- package/dist/types/eengine/fixtures/providers.json +1 -1
- package/dist/types/eengine/src/capabilities.d.ts +2 -0
- package/dist/types/eengine/src/index.d.ts +1 -0
- package/dist/types/eengine/src/instance.d.ts +9 -0
- package/dist/types/eengine/src/synced.d.ts +59 -0
- package/fixtures/capabilities.json +65 -4
- package/fixtures/outbox.json +15 -1
- package/fixtures/providers.json +1 -1
- package/package.json +1 -1
- /package/dist/chunks/{index-ax4aay30.js.map → index-3nf9f7pv.js.map} +0 -0
- /package/dist/chunks/{index-n0acffvs.js.map → index-79swfbsm.js.map} +0 -0
- /package/dist/chunks/{index-nrr8x2kq.js.map → index-knntt4cb.js.map} +0 -0
- /package/dist/chunks/{index-t89cvabm.js.map → index-q4zws02e.js.map} +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/eengine/src/broker.ts", "../../../packages/eengine/src/instance.ts"],
|
|
3
|
+
"sources": ["../../../packages/eengine/src/broker.ts", "../../../packages/eengine/src/instance.ts", "../../../packages/eengine/src/synced.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"// VAPP-269: the capability runtime, the twin of the crate's `capability.rs`.\n// ONE `Broker` per app instance answers app UI calls (`photos_pick`) and\n// agent calls (`photos__pick`) the same way: the package's manifest is the\n// ceiling, the person's consent next (the host paints the sheet and answers\n// through `answer`), then one audit row. Grants persist in the Vault and\n// change ONLY through `setGrant` with `consentUi` after a gesture.\n//\n// USER ACTIVATION (the web): `call` and `answer` reach the native provider\n// without awaiting anything but microtasks (the grants live in memory, the\n// Vault write runs after), so a picker opens inside the click's task.\n\nimport type { HubOutcome } from \"@exp/emcp\"\n\nimport { brokerAuditRow, brokerDecide, type BrokerAuditRow, type BrokerCall, type BrokerVerdict, type CallFrom, type Grants, type GrantValue, type ManifestEntry } from \"./capabilities\"\nimport { consentAnswer, consentSheet, grantsRecord, grantWrite, manageSheet, type ConsentAnswer, type GrantVia, type SurfaceComponent } from \"./consent\"\nimport { bridgeCall, type BlobStore, type McpCallResult, type NativeCapability } from \"./tools\"\n\n/** A refusal or a failure (eCore's shape: a code + a message). */\nexport interface Failure {\n code: string\n message: string\n}\n\n/** Where secrets live (Keychain, Keystore, libsecret; the web: IndexedDB). */\nexport interface Vault {\n read(key: string): Promise<string | null>\n write(key: string, value: string): Promise<void>\n delete(key: string): Promise<void>\n}\n\n/** Where the broker's audit rows go. */\nexport interface CallAudit {\n record(row: BrokerAuditRow): void\n}\n\n/** The ask sheet the person answers (consent.json `consentSheet`): a genUI surface. */\nexport interface ConsentSheet {\n scope: string\n components: SurfaceComponent[]\n data: Record<string, unknown>\n}\n\n/** What a brokered call answers. */\nexport type BrokerAnswer =\n | { result: McpCallResult }\n /** The person decides first: paint the sheet, then `answer`. */\n | { ask: BrokerVerdict; sheet: ConsentSheet }\n /** `code` = `UNKNOWN_TOOL` for unknown, else `FORBIDDEN`; `message` = the reason. */\n | { refused: Failure }\n\nexport interface BrokerSetup {\n appId: string\n appName: string\n signer: string\n manifest: readonly ManifestEntry[]\n grants: Grants\n capabilities: readonly NativeCapability[]\n vault: Vault\n /** The app's files: what capabilities read (`fileId`) and store. */\n blobs: BlobStore\n /** The package's screen names (a notification's tap opens one). */\n screens: readonly string[]\n audit?: CallAudit | null\n}\n\nconst refused = (verdict: BrokerVerdict): BrokerAnswer => ({ refused: { code: verdict.verdict === `unknown` ? `UNKNOWN_TOOL` : `FORBIDDEN`, message: verdict.reason ?? `` } })\n\n/** One app instance's broker. */\nexport class Broker {\n private grantsNow: Grants\n private foreground = false\n /** The last grants write (tests and a closing page await it). */\n persisted: Promise<void> = Promise.resolve()\n\n constructor(private readonly setup: BrokerSetup) {\n this.grantsNow = { ...setup.grants }\n }\n\n get appId(): string {\n return this.setup.appId\n }\n\n get manifest(): readonly ManifestEntry[] {\n return this.setup.manifest\n }\n\n get capabilities(): readonly NativeCapability[] {\n return this.setup.capabilities\n }\n\n grants(): Grants {\n return { ...this.grantsNow }\n }\n\n /** The lifecycle tells the broker whether a sheet may show. */\n setForeground(foreground: boolean): void {\n this.foreground = foreground\n }\n\n private provided(): string[] {\n return this.setup.capabilities.map((c) => c.name)\n }\n\n private record(client: string | null, call: BrokerCall, verdict: BrokerVerdict, outcome: HubOutcome | null): void {\n this.setup.audit?.record(brokerAuditRow({ appId: this.setup.appId, client, call, verdict, outcome }))\n }\n\n private async run(client: string | null, call: BrokerCall, verdict: BrokerVerdict): Promise<BrokerAnswer> {\n const capability = this.setup.capabilities.find((c) => c.name === verdict.capability)\n if (!capability || !verdict.tool) {\n this.record(client, call, verdict, `unreachable`)\n return { refused: { code: `FORBIDDEN`, message: `unavailable` } }\n }\n const { result, outcome } = await bridgeCall({\n tool: `${capability.name}_${verdict.tool}`,\n arguments: call.arguments ?? {},\n context: { app: this.setup.appId, screens: this.setup.screens },\n blobs: this.setup.blobs,\n native: (tool, args) => capability.call(tool.slice(tool.indexOf(`_`) + 1), args),\n })\n this.record(client, call, verdict, outcome)\n return { result }\n }\n\n /** One call from app UI (`client` = null) or an agent run (`client` = its run id). */\n call(from: CallFrom, client: string | null, name: string, args: unknown): Promise<BrokerAnswer> {\n const call: BrokerCall = { from, name, arguments: args }\n const verdict = brokerDecide({ manifest: this.setup.manifest, grants: this.grantsNow, provided: this.provided(), foreground: this.foreground, call })\n if (verdict.verdict === `call`) return this.run(client, call, verdict)\n if (verdict.verdict === `ask`) {\n const entry = this.setup.manifest.find((m) => m.id === verdict.scope) ?? { id: verdict.scope ?? ``, why: `` }\n const { components, data } = consentSheet(this.setup.appName, entry)\n return Promise.resolve({ ask: verdict, sheet: { scope: entry.id, components, data } })\n }\n this.record(client, call, verdict, null)\n return Promise.resolve(refused(verdict))\n }\n\n /** The person's answer to the sheet for `verdict` (an Ask): store it per\n * consent.json, then run or refuse the call. The answer is the gesture. */\n answer(from: CallFrom, client: string | null, name: string, args: unknown, verdict: BrokerVerdict, answer: ConsentAnswer): Promise<BrokerAnswer> {\n const call: BrokerCall = { from, name, arguments: args }\n if (!verdict.scope) return Promise.resolve(refused(verdict))\n const next = consentAnswer(this.grantsNow, verdict.scope, answer)\n this.grantsNow = next.grants\n this.persist(next.grants)\n const decided: BrokerVerdict = { ...verdict, verdict: next.verdict, reason: next.reason }\n if (next.verdict === `call`) return this.run(client, call, decided)\n this.record(client, call, decided, null)\n return Promise.resolve(refused(decided))\n }\n\n /** Change a grant (the Permissions sheet's Switch). Only the ConsentUi\n * after a gesture; `value` null = revoke. Answers consent.json's refusal, or null. */\n setGrant(via: GrantVia, gesture: boolean, scope: string, value: GrantValue | null): string | null {\n const next = grantWrite(this.setup.manifest, this.grantsNow, { via, gesture, scope, value })\n if (next.refused) return next.refused\n this.grantsNow = next.grants\n this.persist(next.grants)\n return null\n }\n\n /** The Permissions sheet (consent.json `manageSheet`). */\n permissionsSheet(): SurfaceComponent[] {\n return manageSheet(this.setup.manifest, this.grantsNow)\n }\n\n private persist(grants: Grants): void {\n const { key, value } = grantsRecord(this.setup.appId, this.setup.signer, this.setup.manifest, grants)\n // A failed write only means the person is asked again next launch.\n this.persisted = this.persisted.then(() => this.setup.vault.write(key, value)).catch(() => {})\n }\n}\n",
|
|
6
|
-
"// VAPP-269: an `AppInstance`, one running app over a host's providers, the\n// twin of the crate's `instance.rs`: load and verify its package file,\n// drive its lifecycle (lifecycle.json) and carry out the effects, resolve\n// `records:<kind>` sources with genUI's one records query, dispatch\n// `records_*`, `app_navigate` and capability calls (the broker, the E5\n// bridge), and keep O1's outbox when the host has a sync provider\n// (outbox.json: direct writes otherwise).\n\nimport {\n kindComputed,\n kindRefs,\n kindTransitions,\n navigateTarget,\n packageScreens,\n parseRecordsSource,\n parseSource,\n recordPolicy,\n recordsValue,\n bridgePackage,\n validatePackage,\n verifyPackageFile,\n type PackageIssue,\n type RecordOp,\n type RecordRow,\n type RecordsValue,\n} from \"@exponential_app/eui/host\"\n\nimport { Broker, type BrokerAnswer, type CallAudit, type ConsentSheet, type Failure, type Vault } from \"./broker\"\nimport type { BrokerVerdict, Grants, GrantValue, ManifestEntry } from \"./capabilities\"\nimport { grantsOnPackage, grantsRecord, type ConsentAnswer, type GrantVia, type SurfaceComponent } from \"./consent\"\nimport { lifecycleStep, STOPPED, type LifecycleEffect, type LifecycleEvent, type LifecycleState } from \"./lifecycle\"\nimport { outboxFlush, outboxMode, outboxOutcome, outboxPrune, outboxRequest, outboxRows, outboxWrites, type OutboxCall, type OutboxEntry, type OutboxResult, type OutboxWrite } from \"./outbox\"\nimport { engineRecordRefusal, engineViewer, type EngineIdentity, type NetworkPolicy } from \"./providers\"\nimport type { EngineRecordStore, WriteBatch } from \"./stores\"\nimport type { BlobStore, NativeCapability } from \"./tools\"\n\nexport type Presentation = `replace` | `push` | `sheet`\n\n/** Maps screens to windows (desktop), nav stacks and sheets (phones), the page (the web). */\nexport interface WindowHost {\n open(app: string, screen: string, params: Record<string, string>, how: Presentation): void\n}\n\n/** An optional transport to an authority; absent = the store is the authority, no outbox. */\nexport interface SyncTransport {\n push(app: string, call: OutboxCall, input: Record<string, unknown>): Promise<OutboxResult>\n}\n\n/** What a host hands the Engine (providers.json; no telemetry or update key: none exists). */\nexport interface EngineHostConfig {\n host: { kind: string; platform: string; formFactor: string; locale: string }\n storage: EngineRecordStore\n blobs: BlobStore\n identity: EngineIdentity\n vault: Vault\n window: WindowHost\n /** ISO 8601 UTC with milliseconds (tests pin it). */\n clock?: () => string\n network: NetworkPolicy\n sync?: SyncTransport | null\n capabilities: readonly NativeCapability[]\n audit?: CallAudit | null\n newId?: () => string\n}\n\n/** Why a package could not load: `signature` (signed, does not verify) or `invalid` (genUI refuses it). */\nexport class LoadError extends Error {\n constructor(\n readonly kind: `signature` | `invalid`,\n readonly issues: PackageIssue[],\n ) {\n super(`${kind}: ${issues.map((i) => `${i.path || `/`} ${i.message}`).join(`; `)}`)\n this.name = `LoadError`\n }\n}\n\n/** What a host function call answers. */\nexport type CallResult =\n | { value: unknown }\n /** The person decides first: paint the sheet, then `answerConsent` with the same call. */\n | { ask: BrokerVerdict; sheet: ConsentSheet }\n /** Refused (the failed-action toast's reason). */\n | { refused: Failure }\n\n/** Where the instance keeps its last screen (lifecycle.json `persist`). */\nexport const screenKey = (app: string): string => `eengine/screen/${app}`\n\ntype Pkg = Record<string, unknown> & { id?: unknown; name?: unknown; records?: unknown; capabilities?: unknown; screens?: unknown }\n\nconst isObject = (v: unknown): v is Record<string, unknown> => !!v && typeof v === `object` && !Array.isArray(v)\n\n/** The package a file carries (`package`), or the value itself when it is a bare package. */\nexport const packageOf = (file: unknown): unknown => (isObject(file) && isObject(file.package) ? file.package : file)\n\n/** VAPP-271: app UI reads a capability's answer as its `structuredContent`\n * (an action step's `results.<name>`); an `isError` result is the call's\n * refusal, its text the toast. */\nconst brokered = (answer: BrokerAnswer): CallResult => {\n if (!(`result` in answer)) return answer\n const { result } = answer\n if (result.isError) return { refused: { code: `failed`, message: result.content[0]?.text ?? `failed` } }\n return { value: result.structuredContent ?? null }\n}\n\nconst failure = (code: string, error: unknown): Failure =>\n isObject(error) && typeof error.code === `string` && typeof error.message === `string` ? { code: error.code, message: error.message } : { code, message: error instanceof Error ? error.message : String(error) }\n\nconst parseLast = (stored: string | null): { screen: string; params: Record<string, unknown> } | null => {\n if (!stored) return null\n try {\n const v = JSON.parse(stored)\n return isObject(v) && typeof v.screen === `string` && isObject(v.params) ? { screen: v.screen, params: v.params } : null\n } catch {\n return null\n }\n}\n\n/** One running app. */\nexport class AppInstance {\n private stateNow: LifecycleState = STOPPED\n private outboxNow: OutboxEntry[] = []\n private lastScreen: string | null\n\n private constructor(\n private readonly config: EngineHostConfig,\n readonly pkg: Pkg,\n readonly appId: string,\n readonly signer: string | null,\n readonly broker: Broker,\n lastScreen: string | null,\n ) {\n this.lastScreen = lastScreen\n }\n\n /** Load a package file (or a bare package): verify its signature when it\n * carries one, validate the package, reconcile its grants. */\n static async load(config: EngineHostConfig, file: unknown): Promise<AppInstance> {\n const verification = await verifyPackageFile(file)\n if (verification.status === `invalid`) throw new LoadError(`signature`, verification.issues)\n // Round 9 §12: format 5 through the bridge while ACCEPT_V09 holds.\n const pkg = bridgePackage(packageOf(file))\n const issues = validatePackage(pkg)\n if (issues.length) throw new LoadError(`invalid`, issues)\n const p = pkg as Pkg\n const appId = typeof p.id === `string` ? p.id : ``\n const signer = verification.status === `valid` ? verification.author.key : null\n const manifest: ManifestEntry[] = Array.isArray(p.capabilities) ? (p.capabilities as ManifestEntry[]) : []\n const key = grantsRecord(appId, signer ?? ``, manifest, {}).key\n const [storedGrants, lastScreen] = await Promise.all([config.vault.read(key).catch(() => null), config.vault.read(screenKey(appId)).catch(() => null)])\n const broker = new Broker({\n appId,\n appName: typeof p.name === `string` ? p.name : appId,\n signer: signer ?? ``,\n manifest,\n grants: grantsOnPackage(storedGrants, signer ?? ``, manifest),\n capabilities: config.capabilities,\n vault: config.vault,\n blobs: config.blobs,\n screens: packageScreens(p).map((s) => s.template),\n audit: config.audit ?? null,\n })\n return new AppInstance(config, p, appId, signer, broker, lastScreen)\n }\n\n get manifest(): readonly ManifestEntry[] {\n return this.broker.manifest\n }\n\n grants(): Grants {\n return this.broker.grants()\n }\n\n get state(): LifecycleState {\n return this.stateNow\n }\n\n /** The outbox entries still pending or acked (queue mode). */\n get outbox(): readonly OutboxEntry[] {\n return this.outboxNow\n }\n\n get mode(): `queue` | `direct` {\n return outboxMode(!!this.config.sync)\n }\n\n private me(): string {\n return engineViewer(this.config.identity).id ?? ``\n }\n\n private now(): string {\n return this.config.clock?.() ?? new Date().toISOString()\n }\n\n /** The person answered the sheet of an Ask for this call (the answer is the gesture). */\n async answerConsent(name: string, args: unknown, verdict: BrokerVerdict, answer: ConsentAnswer): Promise<CallResult> {\n return brokered(await this.broker.answer(`ui`, null, name, args, verdict, answer))\n }\n\n /** The Permissions sheet's Switch: only the ConsentUi, after a gesture. Answers the refusal, or null. */\n setGrant(via: GrantVia, gesture: boolean, scope: string, value: GrantValue | null): string | null {\n return this.broker.setGrant(via, gesture, scope, value)\n }\n\n /** The Permissions sheet (a genUI surface). */\n permissionsSheet(): SurfaceComponent[] {\n return this.broker.permissionsSheet()\n }\n\n /** One lifecycle event: the next state, with its effects carried out\n * (open → the WindowHost, persist → the Vault, flush → the outbox).\n * Answers the effects (sources and automations are the host's). */\n async event(event: LifecycleEvent): Promise<LifecycleEffect[]> {\n const { state, effects } = lifecycleStep(this.stateNow, event, { pkg: { id: this.appId, screens: this.pkg.screens }, lastScreen: parseLast(this.lastScreen) })\n this.stateNow = state\n this.broker.setForeground(state.phase === `foreground`)\n for (const effect of effects) {\n if (effect.effect === `open`) this.config.window.open(this.appId, effect.screen, effect.params, `replace`)\n else if (effect.effect === `persist`) {\n this.lastScreen = JSON.stringify({ screen: effect.screen, params: effect.params })\n await this.config.vault.write(screenKey(this.appId), this.lastScreen).catch(() => {})\n } else if (effect.effect === `flush`) await this.flush()\n }\n return effects\n }\n\n /** A `records:<kind>?…` source's value (genUI's records query over the\n * store's rows with the outbox laid over them); undefined = not a records source. */\n async recordsValue(source: string): Promise<RecordsValue | null | undefined> {\n const parsed = parseSource(source)\n const query = parsed ? parseRecordsSource(parsed) : null\n if (!query) return undefined\n if (query.app !== null) return null\n let rows: RecordRow[] = await this.config.storage.rows(this.appId)\n if (this.outboxNow.length) rows = outboxRows(rows, this.outboxNow, this.me())\n const records = this.pkg.records\n const def = query.from && isObject(records) ? records[query.from] : undefined\n const viewer = engineViewer(this.config.identity)\n return recordsValue(rows, query, {\n me: viewer.id,\n now: this.now(),\n names: {},\n computed: kindComputed(records, query.from),\n refs: kindRefs(records, query.from),\n transitions: kindTransitions(def),\n role: viewer.role,\n })\n }\n\n /** Called with every change to the app's rows (re-resolve the bound sources). */\n subscribe(on: () => void): () => void {\n return this.config.storage.subscribe(this.appId, () => on())\n }\n\n /** A host function call from the app's UI: `records_upsert` /\n * `records_delete` / `records_batch`, `app_navigate`, or a capability\n * (`<capability>.<tool>`, through the broker). `newIds` = the client ids of\n * its creates, in order. */\n async call(name: string, args: unknown, newIds: readonly string[] = []): Promise<CallResult> {\n const a = isObject(args) ? args : {}\n switch (name) {\n case `records_upsert`:\n return this.write(`upsert`, a, newIds)\n case `records_delete`:\n return this.write(`delete`, a, newIds)\n case `records_batch`:\n return this.write(`batch`, a, newIds)\n case `app_navigate`: {\n const target = navigateTarget(this.pkg, args)\n if (`error` in target) return { refused: { code: `BAD_REQUEST`, message: target.error } }\n this.config.window.open(this.appId, target.screen, target.params, `replace`)\n this.stateNow = { ...this.stateNow, screen: target.screen, params: target.params }\n return { value: null }\n }\n default:\n return brokered(await this.broker.call(`ui`, null, name, args))\n }\n }\n\n /** The kind policy check for a write, as the identity sees it. */\n private async refusal(writes: OutboxWrite[]): Promise<string | null> {\n const rows = await this.config.storage.rows(this.appId).catch(() => [] as RecordRow[])\n const records = isObject(this.pkg.records) ? this.pkg.records : {}\n for (const w of writes) {\n const row = rows.find((r) => r.id === w.id)\n const op: RecordOp = w.op\n const kind = w.op === `delete` ? row?.kind : w.kind\n const policy = recordPolicy(kind ? records[kind] : undefined)\n const refusal = engineRecordRefusal(this.config.identity, policy, op, w.op === `create` ? null : row ? { authorId: row.authorId ?? null, createdBy: row.createdBy } : null)\n if (refusal) return refusal\n }\n return null\n }\n\n private async write(call: OutboxCall, args: Record<string, unknown>, newIds: readonly string[]): Promise<CallResult> {\n const writes = outboxWrites(call, args, newIds)\n const refusal = await this.refusal(writes)\n if (refusal) return { refused: { code: `FORBIDDEN`, message: refusal } }\n const entry: OutboxEntry = { writeId: this.config.newId?.() ?? crypto.randomUUID(), appId: this.appId, call, writes, at: this.now(), state: `pending` }\n const answer = call === `upsert` ? { id: writes[0]?.id } : call === `delete` ? null : { ids: writes.map((w) => w.id) }\n if (this.mode === `direct`) {\n try {\n await this.config.storage.write(this.appId, batchOf(entry), this.me())\n return { value: answer }\n } catch (error) {\n return { refused: failure(`STORE`, error) }\n }\n }\n this.outboxNow = [...this.outboxNow, entry]\n if (this.stateNow.phase === `foreground`) await this.flush()\n return { value: answer }\n }\n\n /** Flush the outbox through the sync provider (FIFO, a retry stops it). */\n async flush(): Promise<void> {\n const sync = this.config.sync\n if (!sync) return\n const results: Record<string, OutboxResult> = {}\n for (const entry of this.outboxNow.filter((e) => e.state === `pending`)) {\n const { call, input } = outboxRequest(entry)\n const result = await sync.push(this.appId, call, input).catch((): OutboxResult => ({ transport: true }))\n results[entry.writeId] = result\n if (outboxOutcome(entry, result) === `retry`) break\n }\n if (!Object.keys(results).length) return\n const now = this.now()\n const after = outboxFlush(this.outboxNow, results, now).after\n // Acked entries keep overlaying until the store reflects them (outboxPrune).\n const rows = await this.config.storage.rows(this.appId).catch(() => [] as RecordRow[])\n this.outboxNow = outboxPrune(after, rows, now)\n }\n}\n\n/** An outbox entry as one store batch. */\nexport function batchOf(entry: OutboxEntry): WriteBatch {\n return {\n writeId: entry.writeId,\n writes: entry.writes.map((w) => (w.op === `delete` ? { op: `delete`, id: w.id } : { op: `upsert`, id: w.id, kind: w.kind, data: w.data, create: w.op === `create` })),\n at: entry.at,\n }\n}\n\n/** How many client ids a call's creates take (the runner generates them). */\nexport function createsOf(name: string, args: unknown): number {\n if (!isObject(args)) return 0\n if (name === `records_upsert`) return typeof args.id === `string` ? 0 : 1\n if (name === `records_batch` && Array.isArray(args.writes)) return args.writes.filter((w) => isObject(w) && w.op !== `delete` && typeof w.id !== `string`).length\n return 0\n}\n"
|
|
6
|
+
"// VAPP-269: an `AppInstance`, one running app over a host's providers, the\n// twin of the crate's `instance.rs`: load and verify its package file,\n// drive its lifecycle (lifecycle.json) and carry out the effects, resolve\n// `records:<kind>` sources with genUI's one records query, dispatch\n// `records_*`, `app_navigate` and capability calls (the broker, the E5\n// bridge), and keep O1's outbox when the host has a sync provider\n// (outbox.json: direct writes otherwise).\n\nimport {\n kindComputed,\n kindRefs,\n kindTransitions,\n navigateTarget,\n packageScreens,\n parseRecordsSource,\n parseSource,\n recordPolicy,\n recordsValue,\n bridgePackage,\n validatePackage,\n verifyPackageFile,\n type PackageIssue,\n type RecordOp,\n type RecordRow,\n type RecordsValue,\n} from \"@exponential_app/eui/host\"\n\nimport { Broker, type BrokerAnswer, type CallAudit, type ConsentSheet, type Failure, type Vault } from \"./broker\"\nimport type { BrokerVerdict, Grants, GrantValue, ManifestEntry } from \"./capabilities\"\nimport { grantsOnPackage, grantsRecord, type ConsentAnswer, type GrantVia, type SurfaceComponent } from \"./consent\"\nimport { lifecycleStep, STOPPED, type LifecycleEffect, type LifecycleEvent, type LifecycleState } from \"./lifecycle\"\nimport { outboxFlush, outboxMode, outboxOutcome, outboxPrune, outboxRequest, outboxRows, outboxWrites, type OutboxCall, type OutboxEntry, type OutboxResult, type OutboxWrite } from \"./outbox\"\nimport { engineRecordRefusal, engineViewer, type EngineIdentity, type NetworkPolicy } from \"./providers\"\nimport type { EngineRecordStore, WriteBatch } from \"./stores\"\nimport type { BlobStore, NativeCapability } from \"./tools\"\n\nexport type Presentation = `replace` | `push` | `sheet`\n\n/** Maps screens to windows (desktop), nav stacks and sheets (phones), the page (the web). */\nexport interface WindowHost {\n open(app: string, screen: string, params: Record<string, string>, how: Presentation): void\n}\n\n/** An optional transport to an authority; absent = the store is the authority, no outbox. */\nexport interface SyncTransport {\n push(app: string, call: OutboxCall, input: Record<string, unknown>): Promise<OutboxResult>\n /** `push` with the server's answer, for a call that awaits its own entry. */\n send?(app: string, call: OutboxCall, input: Record<string, unknown>): Promise<Pushed>\n}\n\n/** One replay as a transport answers it. */\nexport interface Pushed {\n result: OutboxResult\n answer?: unknown\n message?: string\n invalid?: boolean\n}\n\n/** What a host hands the Engine (providers.json; no telemetry or update key: none exists). */\nexport interface EngineHostConfig {\n host: { kind: string; platform: string; formFactor: string; locale: string }\n storage: EngineRecordStore\n blobs: BlobStore\n identity: EngineIdentity\n vault: Vault\n window: WindowHost\n /** ISO 8601 UTC with milliseconds (tests pin it). */\n clock?: () => string\n network: NetworkPolicy\n sync?: SyncTransport | null\n capabilities: readonly NativeCapability[]\n audit?: CallAudit | null\n newId?: () => string\n}\n\n/** Why a package could not load: `signature` (signed, does not verify) or `invalid` (genUI refuses it). */\nexport class LoadError extends Error {\n constructor(\n readonly kind: `signature` | `invalid`,\n readonly issues: PackageIssue[],\n ) {\n super(`${kind}: ${issues.map((i) => `${i.path || `/`} ${i.message}`).join(`; `)}`)\n this.name = `LoadError`\n }\n}\n\n/** What a host function call answers. */\nexport type CallResult =\n | { value: unknown }\n /** The person decides first: paint the sheet, then `answerConsent` with the same call. */\n | { ask: BrokerVerdict; sheet: ConsentSheet }\n /** Refused (the failed-action toast's reason). */\n | { refused: Failure }\n\n/** Where the instance keeps its last screen (lifecycle.json `persist`). */\nexport const screenKey = (app: string): string => `eengine/screen/${app}`\n\ntype Pkg = Record<string, unknown> & { id?: unknown; name?: unknown; records?: unknown; capabilities?: unknown; screens?: unknown }\n\nconst isObject = (v: unknown): v is Record<string, unknown> => !!v && typeof v === `object` && !Array.isArray(v)\n\n/** The package a file carries (`package`), or the value itself when it is a bare package. */\nexport const packageOf = (file: unknown): unknown => (isObject(file) && isObject(file.package) ? file.package : file)\n\n/** VAPP-271: app UI reads a capability's answer as its `structuredContent`\n * (an action step's `results.<name>`); an `isError` result is the call's\n * refusal, its text the toast. */\nconst brokered = (answer: BrokerAnswer): CallResult => {\n if (!(`result` in answer)) return answer\n const { result } = answer\n if (result.isError) return { refused: { code: `failed`, message: result.content[0]?.text ?? `failed` } }\n return { value: result.structuredContent ?? null }\n}\n\nconst failure = (code: string, error: unknown): Failure =>\n isObject(error) && typeof error.code === `string` && typeof error.message === `string` ? { code: error.code, message: error.message } : { code, message: error instanceof Error ? error.message : String(error) }\n\nconst parseLast = (stored: string | null): { screen: string; params: Record<string, unknown> } | null => {\n if (!stored) return null\n try {\n const v = JSON.parse(stored)\n return isObject(v) && typeof v.screen === `string` && isObject(v.params) ? { screen: v.screen, params: v.params } : null\n } catch {\n return null\n }\n}\n\n/** One running app. */\nexport class AppInstance {\n private stateNow: LifecycleState = STOPPED\n private outboxNow: OutboxEntry[] = []\n private lastScreen: string | null\n\n private constructor(\n private readonly config: EngineHostConfig,\n readonly pkg: Pkg,\n readonly appId: string,\n readonly signer: string | null,\n readonly broker: Broker,\n lastScreen: string | null,\n ) {\n this.lastScreen = lastScreen\n }\n\n /** Load a package file (or a bare package): verify its signature when it\n * carries one, validate the package, reconcile its grants. */\n static async load(config: EngineHostConfig, file: unknown): Promise<AppInstance> {\n const verification = await verifyPackageFile(file)\n if (verification.status === `invalid`) throw new LoadError(`signature`, verification.issues)\n // Round 9 §12: format 5 through the bridge while ACCEPT_V09 holds.\n const pkg = bridgePackage(packageOf(file))\n const issues = validatePackage(pkg)\n if (issues.length) throw new LoadError(`invalid`, issues)\n const p = pkg as Pkg\n const appId = typeof p.id === `string` ? p.id : ``\n const signer = verification.status === `valid` ? verification.author.key : null\n const manifest: ManifestEntry[] = Array.isArray(p.capabilities) ? (p.capabilities as ManifestEntry[]) : []\n const key = grantsRecord(appId, signer ?? ``, manifest, {}).key\n const [storedGrants, lastScreen] = await Promise.all([config.vault.read(key).catch(() => null), config.vault.read(screenKey(appId)).catch(() => null)])\n const broker = new Broker({\n appId,\n appName: typeof p.name === `string` ? p.name : appId,\n signer: signer ?? ``,\n manifest,\n grants: grantsOnPackage(storedGrants, signer ?? ``, manifest),\n capabilities: config.capabilities,\n vault: config.vault,\n blobs: config.blobs,\n screens: packageScreens(p).map((s) => s.template),\n audit: config.audit ?? null,\n })\n return new AppInstance(config, p, appId, signer, broker, lastScreen)\n }\n\n get manifest(): readonly ManifestEntry[] {\n return this.broker.manifest\n }\n\n grants(): Grants {\n return this.broker.grants()\n }\n\n get state(): LifecycleState {\n return this.stateNow\n }\n\n /** The outbox entries still pending or acked (queue mode). */\n get outbox(): readonly OutboxEntry[] {\n return this.outboxNow\n }\n\n get mode(): `queue` | `direct` {\n return outboxMode(!!this.config.sync)\n }\n\n private me(): string {\n return engineViewer(this.config.identity).id ?? ``\n }\n\n private now(): string {\n return this.config.clock?.() ?? new Date().toISOString()\n }\n\n /** The person answered the sheet of an Ask for this call (the answer is the gesture). */\n async answerConsent(name: string, args: unknown, verdict: BrokerVerdict, answer: ConsentAnswer): Promise<CallResult> {\n return brokered(await this.broker.answer(`ui`, null, name, args, verdict, answer))\n }\n\n /** The Permissions sheet's Switch: only the ConsentUi, after a gesture. Answers the refusal, or null. */\n setGrant(via: GrantVia, gesture: boolean, scope: string, value: GrantValue | null): string | null {\n return this.broker.setGrant(via, gesture, scope, value)\n }\n\n /** The Permissions sheet (a genUI surface). */\n permissionsSheet(): SurfaceComponent[] {\n return this.broker.permissionsSheet()\n }\n\n /** One lifecycle event: the next state, with its effects carried out\n * (open → the WindowHost, persist → the Vault, flush → the outbox).\n * Answers the effects (sources and automations are the host's). */\n async event(event: LifecycleEvent): Promise<LifecycleEffect[]> {\n const { state, effects } = lifecycleStep(this.stateNow, event, { pkg: { id: this.appId, screens: this.pkg.screens }, lastScreen: parseLast(this.lastScreen) })\n this.stateNow = state\n this.broker.setForeground(state.phase === `foreground`)\n for (const effect of effects) {\n if (effect.effect === `open`) this.config.window.open(this.appId, effect.screen, effect.params, `replace`)\n else if (effect.effect === `persist`) {\n this.lastScreen = JSON.stringify({ screen: effect.screen, params: effect.params })\n await this.config.vault.write(screenKey(this.appId), this.lastScreen).catch(() => {})\n } else if (effect.effect === `flush`) await this.flush()\n }\n return effects\n }\n\n /** A `records:<kind>?…` source's value (genUI's records query over the\n * store's rows with the outbox laid over them); undefined = not a records source. */\n async recordsValue(source: string): Promise<RecordsValue | null | undefined> {\n const parsed = parseSource(source)\n const query = parsed ? parseRecordsSource(parsed) : null\n if (!query) return undefined\n if (query.app !== null) return null\n let rows: RecordRow[] = await this.config.storage.rows(this.appId)\n if (this.outboxNow.length) rows = outboxRows(rows, this.outboxNow, this.me())\n const records = this.pkg.records\n const def = query.from && isObject(records) ? records[query.from] : undefined\n const viewer = engineViewer(this.config.identity)\n return recordsValue(rows, query, {\n me: viewer.id,\n now: this.now(),\n names: {},\n computed: kindComputed(records, query.from),\n refs: kindRefs(records, query.from),\n transitions: kindTransitions(def),\n role: viewer.role,\n })\n }\n\n /** Called with every change to the app's rows (re-resolve the bound sources). */\n subscribe(on: () => void): () => void {\n return this.config.storage.subscribe(this.appId, () => on())\n }\n\n /** A host function call from the app's UI: `records_upsert` /\n * `records_delete` / `records_batch`, `app_navigate`, or a capability\n * (`<capability>.<tool>`, through the broker). `newIds` = the client ids of\n * its creates, in order. */\n async call(name: string, args: unknown, newIds: readonly string[] = []): Promise<CallResult> {\n const a = isObject(args) ? args : {}\n switch (name) {\n case `records_upsert`:\n return this.write(`upsert`, a, newIds)\n case `records_delete`:\n return this.write(`delete`, a, newIds)\n case `records_batch`:\n return this.write(`batch`, a, newIds)\n case `app_navigate`: {\n const target = navigateTarget(this.pkg, args)\n if (`error` in target) return { refused: { code: `BAD_REQUEST`, message: target.error } }\n this.config.window.open(this.appId, target.screen, target.params, `replace`)\n this.stateNow = { ...this.stateNow, screen: target.screen, params: target.params }\n return { value: null }\n }\n default:\n return brokered(await this.broker.call(`ui`, null, name, args))\n }\n }\n\n /** The kind policy check for a write, as the identity sees it. */\n private async refusal(writes: OutboxWrite[]): Promise<string | null> {\n const rows = await this.config.storage.rows(this.appId).catch(() => [] as RecordRow[])\n const records = isObject(this.pkg.records) ? this.pkg.records : {}\n for (const w of writes) {\n const row = rows.find((r) => r.id === w.id)\n const op: RecordOp = w.op\n const kind = w.op === `delete` ? row?.kind : w.kind\n const policy = recordPolicy(kind ? records[kind] : undefined)\n const refusal = engineRecordRefusal(this.config.identity, policy, op, w.op === `create` ? null : row ? { authorId: row.authorId ?? null, createdBy: row.createdBy } : null)\n if (refusal) return refusal\n }\n return null\n }\n\n private async write(call: OutboxCall, args: Record<string, unknown>, newIds: readonly string[]): Promise<CallResult> {\n const writes = outboxWrites(call, args, newIds)\n const refusal = await this.refusal(writes)\n if (refusal) return { refused: { code: `FORBIDDEN`, message: refusal } }\n const entry: OutboxEntry = { writeId: this.config.newId?.() ?? crypto.randomUUID(), appId: this.appId, call, writes, at: this.now(), state: `pending` }\n const answer = call === `upsert` ? { id: writes[0]?.id } : call === `delete` ? null : { ids: writes.map((w) => w.id) }\n if (this.mode === `direct`) {\n try {\n await this.config.storage.write(this.appId, batchOf(entry), this.me())\n return { value: answer }\n } catch (error) {\n return { refused: failure(`STORE`, error) }\n }\n }\n this.outboxNow = [...this.outboxNow, entry]\n if (this.stateNow.phase === `foreground`) await this.flush()\n return { value: answer }\n }\n\n /** Flush the outbox through the sync provider (FIFO, a retry stops it). */\n async flush(): Promise<void> {\n const sync = this.config.sync\n if (!sync) return\n const results: Record<string, OutboxResult> = {}\n for (const entry of this.outboxNow.filter((e) => e.state === `pending`)) {\n const { call, input } = outboxRequest(entry)\n const result = await sync.push(this.appId, call, input).catch((): OutboxResult => ({ transport: true }))\n results[entry.writeId] = result\n if (outboxOutcome(entry, result) === `retry`) break\n }\n if (!Object.keys(results).length) return\n const now = this.now()\n const after = outboxFlush(this.outboxNow, results, now).after\n // Acked entries keep overlaying until the store reflects them (outboxPrune).\n const rows = await this.config.storage.rows(this.appId).catch(() => [] as RecordRow[])\n this.outboxNow = outboxPrune(after, rows, now)\n }\n}\n\n/** An outbox entry as one store batch. */\nexport function batchOf(entry: OutboxEntry): WriteBatch {\n return {\n writeId: entry.writeId,\n writes: entry.writes.map((w) => (w.op === `delete` ? { op: `delete`, id: w.id } : { op: `upsert`, id: w.id, kind: w.kind, data: w.data, create: w.op === `create` })),\n at: entry.at,\n }\n}\n\n/** How many client ids a call's creates take (the runner generates them). */\nexport function createsOf(name: string, args: unknown): number {\n if (!isObject(args)) return 0\n if (name === `records_upsert`) return typeof args.id === `string` ? 0 : 1\n if (name === `records_batch` && Array.isArray(args.writes)) return args.writes.filter((w) => isObject(w) && w.op !== `delete` && typeof w.id !== `string`).length\n return 0\n}\n",
|
|
7
|
+
"// VAPP-272: the twin of the crate's `synced::SyncedRecordStore`: one account's\n// outbox across its apps over a host's `OutboxLog` and transport, and the\n// synced rows the host feeds in. `fixtures/outbox.json` `syncedCases` is the\n// contract. The web stays online-only and does not run it; the twin keeps the\n// fixture replayed in both languages.\n\nimport type { RecordRow } from \"@exponential_app/eui/host\"\n\nimport type { Pushed, SyncTransport } from \"./instance\"\nimport { outboxOutcome, outboxPendingLabel, outboxPrune, outboxRequest, outboxRows, outboxVerb, type OutboxCall, type OutboxEntry } from \"./outbox\"\n\n/** Where an account's entries persist, oldest first. */\nexport interface OutboxLog {\n entries(): Promise<OutboxEntry[]>\n push(entry: OutboxEntry): Promise<void>\n ack(writeId: string, at: string): Promise<void>\n remove(writeIds: string[]): Promise<void>\n}\n\nexport interface SyncedListener {\n changed?(): void\n /** A replay nobody awaits was refused: the failed-action toast. */\n refused?(entry: OutboxEntry, verb: string, pushed: Pushed): void\n}\n\n/** A host call's answer: its entry's first outcome, or queued (answer from the entry). */\nexport type Submitted = { done: unknown } | { refused: { message: string | null; invalid: boolean } } | { queued: true }\n\nexport class SyncedRecordStore {\n private flushing: Promise<void> | null = null\n private again = false\n private readonly awaited = new Set<string>()\n private readonly outcomes = new Map<string, Submitted>()\n private readonly synced = new Map<string, RecordRow[]>()\n\n private constructor(\n private readonly log: OutboxLog,\n private readonly transport: SyncTransport,\n private readonly now: () => string,\n private readonly listener: SyncedListener | null,\n private queue: OutboxEntry[],\n ) {}\n\n /** Reads the log once: a restart picks the queue up where it stopped. */\n static async open(log: OutboxLog, transport: SyncTransport, now: () => string, listener: SyncedListener | null = null): Promise<SyncedRecordStore> {\n return new SyncedRecordStore(log, transport, now, listener, await log.entries())\n }\n\n entries(): OutboxEntry[] {\n return [...this.queue]\n }\n\n pendingLabel(app: string): string | null {\n return outboxPendingLabel(this.queue, app)\n }\n\n rows(app: string): RecordRow[] {\n return this.synced.get(app) ?? []\n }\n\n visibleRows(app: string, me: string | null): RecordRow[] {\n const entries = this.queue.filter((e) => e.appId === app)\n return entries.length === 0 ? this.rows(app) : (outboxRows(this.rows(app) as never, entries, me) as unknown as RecordRow[])\n }\n\n /** Persist a call's entry; alone and online it replays now and answers\n * its first outcome, otherwise queued with nothing sent. */\n async submit(entry: OutboxEntry, online: boolean): Promise<Submitted> {\n await this.log.push(entry)\n const awaits = online && !this.queue.some((e) => e.state === `pending`)\n if (awaits) this.awaited.add(entry.writeId)\n this.queue.push(entry)\n this.listener?.changed?.()\n if (!awaits) return { queued: true }\n await this.flush()\n if (this.flushing) await this.flushing\n this.awaited.delete(entry.writeId)\n const outcome = this.outcomes.get(entry.writeId)\n this.outcomes.delete(entry.writeId)\n return outcome ?? { queued: true }\n }\n\n /** One flusher at a time: a call while one runs asks for another pass. */\n async flush(): Promise<void> {\n if (this.flushing) {\n this.again = true\n return\n }\n this.flushing = this.drain().finally(() => {\n this.flushing = null\n })\n await this.flushing\n }\n\n private async drain(): Promise<void> {\n for (;;) {\n const entry = this.queue.find((e) => e.state === `pending`)\n const stop = entry ? await this.replay(entry) : true\n if (!stop) continue\n const pending = this.queue.some((e) => e.state === `pending`)\n const go = this.again && pending\n this.again = false\n if (!go) return\n }\n }\n\n private async replay(entry: OutboxEntry): Promise<boolean> {\n const { call, input } = outboxRequest(entry)\n const pushed = await this.send(entry.appId, call, input)\n const outcome = outboxOutcome(entry, pushed.result)\n let answer: Submitted = { queued: true }\n if (outcome === `done`) {\n const at = this.now()\n await this.log.ack(entry.writeId, at)\n this.queue = this.queue.map((e) => (e.writeId === entry.writeId ? { ...e, state: `acked`, ackedAt: at } : e))\n answer = { done: pushed.answer ?? null }\n } else if (outcome === `dropped` || outcome === `refused`) {\n await this.log.remove([entry.writeId])\n this.queue = this.queue.filter((e) => e.writeId !== entry.writeId)\n if (outcome === `refused`) answer = { refused: { message: pushed.message ?? null, invalid: pushed.invalid ?? false } }\n }\n if (this.awaited.delete(entry.writeId)) this.outcomes.set(entry.writeId, answer)\n else if (outcome === `refused`) this.listener?.refused?.(entry, outboxVerb(entry), pushed)\n if (outcome === `done`) await this.prune()\n this.listener?.changed?.()\n return outcome === `retry`\n }\n\n private send(app: string, call: OutboxCall, input: Record<string, unknown>): Promise<Pushed> {\n if (this.transport.send) return this.transport.send(app, call, input)\n return this.transport.push(app, call, input).then((result) => ({ result }))\n }\n\n /** Feed `app`'s synced rows in: acked entries they reflect leave. */\n async setRows(app: string, rows: RecordRow[]): Promise<void> {\n this.synced.set(app, rows)\n await this.prune()\n }\n\n /** Drop acked entries reflected or past the grace. An app whose rows were\n * never fed in keeps its entries (an empty cache reads as every delete\n * reflected). */\n async prune(): Promise<void> {\n const now = this.now()\n const gone: string[] = []\n for (const app of new Set(this.queue.filter((e) => e.state !== `pending`).map((e) => e.appId))) {\n const rows = this.synced.get(app)\n if (!rows) continue\n const entries = this.queue.filter((e) => e.appId === app)\n const kept = new Set(outboxPrune(entries, rows as never, now).map((e) => e.writeId))\n gone.push(...entries.filter((e) => !kept.has(e.writeId)).map((e) => e.writeId))\n }\n if (gone.length === 0) return\n await this.log.remove(gone)\n this.queue = this.queue.filter((e) => !gone.includes(e.writeId))\n this.listener?.changed?.()\n }\n}\n"
|
|
7
8
|
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,IAAM,UAAU,CAAC,aAA0C,EAAE,SAAS,EAAE,MAAM,QAAQ,YAAY,YAAY,iBAAiB,aAAa,SAAS,QAAQ,UAAU,GAAG,EAAE;AAAA;AAGrK,MAAM,OAAO;AAAA,EAMW;AAAA,EALrB;AAAA,EACA,aAAa;AAAA,EAErB,YAA2B,QAAQ,QAAQ;AAAA,EAE3C,WAAW,CAAkB,OAAoB;AAAA,IAApB;AAAA,IAC3B,KAAK,YAAY,KAAK,MAAM,OAAO;AAAA;AAAA,MAGjC,KAAK,GAAW;AAAA,IAClB,OAAO,KAAK,MAAM;AAAA;AAAA,MAGhB,QAAQ,GAA6B;AAAA,IACvC,OAAO,KAAK,MAAM;AAAA;AAAA,MAGhB,YAAY,GAAgC;AAAA,IAC9C,OAAO,KAAK,MAAM;AAAA;AAAA,EAGpB,MAAM,GAAW;AAAA,IACf,OAAO,KAAK,KAAK,UAAU;AAAA;AAAA,EAI7B,aAAa,CAAC,YAA2B;AAAA,IACvC,KAAK,a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,CAAC;AAAA,QAAM;AAAA,MACX,MAAM,UAAU,KAAK,MAAM,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG;AAAA,MACxD,MAAM,OAAO,IAAI,IAAI,aAAY,SAAS,MAAe,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;AAAA,MACnF,KAAK,KAAK,GAAG,QAAQ,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;AAAA,IAChF;AAAA,IACA,IAAI,KAAK,WAAW;AAAA,MAAG;AAAA,IACvB,MAAM,KAAK,IAAI,OAAO,IAAI;AAAA,IAC1B,KAAK,QAAQ,KAAK,MAAM,OAAO,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,OAAO,CAAC;AAAA,IAC/D,KAAK,UAAU,UAAU;AAAA;AAE7B;",
|
|
10
|
+
"debugId": "4B8F99E4043BD1B764756E2164756E21",
|
|
10
11
|
"names": []
|
|
11
12
|
}
|
package/dist/outbox.js
CHANGED
package/dist/pdf.js
CHANGED
package/dist/providers.js
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
engineViewer2,
|
|
9
9
|
engineRecordRefusal2,
|
|
10
10
|
networkAllows2
|
|
11
|
-
} from "./chunks/index-
|
|
12
|
-
import"./chunks/index-
|
|
11
|
+
} from "./chunks/index-sk8b0dh4.js";
|
|
12
|
+
import"./chunks/index-tvsykgcv.js";
|
|
13
13
|
export {
|
|
14
14
|
AGENT_PROVIDERS2 as AGENT_PROVIDERS,
|
|
15
15
|
FORBIDDEN_HOST_KEYS2 as FORBIDDEN_HOST_KEYS,
|
package/dist/runner.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
runnerPackage2,
|
|
8
8
|
runnerFailure2,
|
|
9
9
|
runnerToast2
|
|
10
|
-
} from "./chunks/index-
|
|
11
|
-
import"./chunks/index-
|
|
10
|
+
} from "./chunks/index-q4zws02e.js";
|
|
11
|
+
import"./chunks/index-tvsykgcv.js";
|
|
12
12
|
export {
|
|
13
13
|
RUNNER_BUNDLE2 as RUNNER_BUNDLE,
|
|
14
14
|
RUNNER_COPY2 as RUNNER_COPY,
|
package/dist/tools.js
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
toolError2,
|
|
15
15
|
bridgeCall2,
|
|
16
16
|
pdfFileName2
|
|
17
|
-
} from "./chunks/index-
|
|
18
|
-
import"./chunks/index-
|
|
17
|
+
} from "./chunks/index-79swfbsm.js";
|
|
18
|
+
import"./chunks/index-3nf9f7pv.js";
|
|
19
19
|
export {
|
|
20
20
|
CAPABILITY_TOOLS2 as CAPABILITY_TOOLS,
|
|
21
21
|
MIME_BY_EXTENSION2 as MIME_BY_EXTENSION,
|
|
@@ -346,6 +346,24 @@ export declare function runAsOptions(members: readonly {
|
|
|
346
346
|
name?: string | null;
|
|
347
347
|
role: string;
|
|
348
348
|
}[], me: string | null, role: string | null): RunAsOption[] | null;
|
|
349
|
+
/** #FEED-204 (`editorDeviceCases`, the fixture's EDITOR DEVICE): the device
|
|
350
|
+
* an app editor's composer shows and sends on. `candidates` = the member's
|
|
351
|
+
* online devices (with a root: the targets a move accepts), default flagged. */
|
|
352
|
+
export interface EditorDeviceChoice {
|
|
353
|
+
/** The device; null = none online and no root to fall back on. */
|
|
354
|
+
deviceId: string | null;
|
|
355
|
+
/** A live root: the row names its device and cannot change. */
|
|
356
|
+
locked: boolean;
|
|
357
|
+
/** An ended root's next send goes to another device. */
|
|
358
|
+
move: boolean;
|
|
359
|
+
}
|
|
360
|
+
export declare function editorDevice(root: {
|
|
361
|
+
status: string;
|
|
362
|
+
deviceId: string | null;
|
|
363
|
+
} | null, candidates: readonly {
|
|
364
|
+
deviceId: string;
|
|
365
|
+
isDefault?: boolean;
|
|
366
|
+
}[], remembered: string | null): EditorDeviceChoice;
|
|
349
367
|
/** #VAPP-220 (`automationRowCases`): one row of the Settings tab's
|
|
350
368
|
* Automations group, from tRPC `appAccess.appTools` `automations`. */
|
|
351
369
|
export interface AutomationRowInput {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"hosts": {
|
|
22
22
|
"exponential": { "host": {}, "storage": {}, "blobs": {}, "identity": { "kind": "member" }, "vault": {}, "window": {}, "zone": {}, "network": "any", "sync": {}, "agents": [{ "id": "acp" }, { "id": "remoteSession" }], "capabilities": [{ "name": "files" }, { "name": "share" }, { "name": "notifications" }] },
|
|
23
23
|
"softcoded": { "host": {}, "storage": {}, "blobs": {}, "identity": { "kind": "local" }, "vault": {}, "window": {}, "network": "upstreamsOnly", "agents": [{ "id": "localModel" }] },
|
|
24
|
-
"ede": { "host": {}, "storage": {}, "blobs": {}, "identity": { "kind": "local" }, "vault": {}, "window": {}, "network": "any", "agents": [{ "id": "acp" }], "capabilities": [{ "name": "files" }, { "name": "notifications" }, { "name": "shell" }] },
|
|
24
|
+
"ede": { "host": {}, "storage": {}, "blobs": {}, "identity": { "kind": "local" }, "vault": {}, "window": {}, "network": "any", "agents": [{ "id": "acp" }], "capabilities": [{ "name": "files" }, { "name": "notifications" }, { "name": "shell" }, { "name": "windows" }, { "name": "focus" }, { "name": "launch" }] },
|
|
25
25
|
"spezl": { "host": {}, "storage": {}, "blobs": {}, "identity": { "kind": "peer" }, "vault": {}, "window": {}, "network": "any", "sync": {}, "agents": [{ "id": "acp" }] },
|
|
26
26
|
"exported": { "host": {}, "storage": {}, "blobs": {}, "identity": { "kind": "local" }, "vault": {}, "window": {}, "network": "off", "capabilities": [{ "name": "photos" }, { "name": "print" }, { "name": "share" }] }
|
|
27
27
|
},
|
|
@@ -15,6 +15,8 @@ export interface CapabilityDef {
|
|
|
15
15
|
name: string;
|
|
16
16
|
label: string;
|
|
17
17
|
scopes: readonly CapabilityScope[];
|
|
18
|
+
/** #VAPP-273: a capability one host alone provides (`ede`); every other host answers `unavailable`. */
|
|
19
|
+
host?: string;
|
|
18
20
|
}
|
|
19
21
|
/** One entry of a package's capability manifest (format 5 `capabilities`). */
|
|
20
22
|
export interface ManifestEntry {
|
|
@@ -15,6 +15,15 @@ export interface WindowHost {
|
|
|
15
15
|
/** An optional transport to an authority; absent = the store is the authority, no outbox. */
|
|
16
16
|
export interface SyncTransport {
|
|
17
17
|
push(app: string, call: OutboxCall, input: Record<string, unknown>): Promise<OutboxResult>;
|
|
18
|
+
/** `push` with the server's answer, for a call that awaits its own entry. */
|
|
19
|
+
send?(app: string, call: OutboxCall, input: Record<string, unknown>): Promise<Pushed>;
|
|
20
|
+
}
|
|
21
|
+
/** One replay as a transport answers it. */
|
|
22
|
+
export interface Pushed {
|
|
23
|
+
result: OutboxResult;
|
|
24
|
+
answer?: unknown;
|
|
25
|
+
message?: string;
|
|
26
|
+
invalid?: boolean;
|
|
18
27
|
}
|
|
19
28
|
/** What a host hands the Engine (providers.json; no telemetry or update key: none exists). */
|
|
20
29
|
export interface EngineHostConfig {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { RecordRow } from "@exponential_app/eui/host";
|
|
2
|
+
import type { Pushed, SyncTransport } from "./instance.js";
|
|
3
|
+
import { type OutboxEntry } from "./outbox.js";
|
|
4
|
+
/** Where an account's entries persist, oldest first. */
|
|
5
|
+
export interface OutboxLog {
|
|
6
|
+
entries(): Promise<OutboxEntry[]>;
|
|
7
|
+
push(entry: OutboxEntry): Promise<void>;
|
|
8
|
+
ack(writeId: string, at: string): Promise<void>;
|
|
9
|
+
remove(writeIds: string[]): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export interface SyncedListener {
|
|
12
|
+
changed?(): void;
|
|
13
|
+
/** A replay nobody awaits was refused: the failed-action toast. */
|
|
14
|
+
refused?(entry: OutboxEntry, verb: string, pushed: Pushed): void;
|
|
15
|
+
}
|
|
16
|
+
/** A host call's answer: its entry's first outcome, or queued (answer from the entry). */
|
|
17
|
+
export type Submitted = {
|
|
18
|
+
done: unknown;
|
|
19
|
+
} | {
|
|
20
|
+
refused: {
|
|
21
|
+
message: string | null;
|
|
22
|
+
invalid: boolean;
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
queued: true;
|
|
26
|
+
};
|
|
27
|
+
export declare class SyncedRecordStore {
|
|
28
|
+
private readonly log;
|
|
29
|
+
private readonly transport;
|
|
30
|
+
private readonly now;
|
|
31
|
+
private readonly listener;
|
|
32
|
+
private queue;
|
|
33
|
+
private flushing;
|
|
34
|
+
private again;
|
|
35
|
+
private readonly awaited;
|
|
36
|
+
private readonly outcomes;
|
|
37
|
+
private readonly synced;
|
|
38
|
+
private constructor();
|
|
39
|
+
/** Reads the log once: a restart picks the queue up where it stopped. */
|
|
40
|
+
static open(log: OutboxLog, transport: SyncTransport, now: () => string, listener?: SyncedListener | null): Promise<SyncedRecordStore>;
|
|
41
|
+
entries(): OutboxEntry[];
|
|
42
|
+
pendingLabel(app: string): string | null;
|
|
43
|
+
rows(app: string): RecordRow[];
|
|
44
|
+
visibleRows(app: string, me: string | null): RecordRow[];
|
|
45
|
+
/** Persist a call's entry; alone and online it replays now and answers
|
|
46
|
+
* its first outcome, otherwise queued with nothing sent. */
|
|
47
|
+
submit(entry: OutboxEntry, online: boolean): Promise<Submitted>;
|
|
48
|
+
/** One flusher at a time: a call while one runs asks for another pass. */
|
|
49
|
+
flush(): Promise<void>;
|
|
50
|
+
private drain;
|
|
51
|
+
private replay;
|
|
52
|
+
private send;
|
|
53
|
+
/** Feed `app`'s synced rows in: acked entries they reflect leave. */
|
|
54
|
+
setRows(app: string, rows: RecordRow[]): Promise<void>;
|
|
55
|
+
/** Drop acked entries reflected or past the grace. An app whose rows were
|
|
56
|
+
* never fed in keeps its entries (an empty cache reads as every delete
|
|
57
|
+
* reflected). */
|
|
58
|
+
prune(): Promise<void>;
|
|
59
|
+
}
|