Artifacts
Register JavaScript artifact providers for Cordova/Capacitor diagnostic exports.
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.