Explain bugs with app state
Preserve Cordova/Capacitor app state as diagnostic exports so a session includes the internal context behind visible behavior.
Artifacts let you capture the state that screenshots cannot show, such as a JavaScript store or navigation snapshot. Expose selected app data as a named export that the local player and agents can request during a session.
Register a JavaScript provider:
const registration = Ansight.registerArtifactProvider({
descriptor: { id: "app.exports", name: "App exports" },
query: async () => [
{
id: "state",
name: "State JSON",
kind: "snapshot",
category: "app",
mimeType: "application/json",
},
],
create: async () => ({
metadata: {
artifactId: "state",
providerId: "app.exports",
name: "State JSON",
kind: "snapshot",
mimeType: "application/json",
fileName: "state.json",
},
payload: { text: JSON.stringify({ ready: true }) },
}),
});
await registration.ready;
Providers are exposed through artifacts.query and artifacts.request. Binary Uint8Array, ArrayBuffer, and byte-array payloads use the native live-session transfer channel.