Work with an AI agent
Let an agent that can run JavaScript in your browser tab build or check a report.
QuackUI publishes commands at window.quack on every page. An agent in a browser you are signed in to can call them. It works as you, with your permissions, on the same draft you see.
Start by asking
quack.help(); // summary and every command id
quack.help("charts.add"); // inputs, result, notes, examples
Commands return a promise.
const r = await quack.invoke("models.list", {});
// { ok: true, value: [...] }
// { ok: false, error: { code, message, details } }
Build a small report
const { value: models } = await quack.invoke("models.list", {});
const model = models.find((m) => m.name === "Retail");
const { value } = await quack.invoke("reports.create", {
name: "Made by an agent",
modelId: model.id,
});
const { docId } = value.document;
const { value: fields } = await quack.invoke("reports.fields", { docId });
const id = (label) => fields.find((f) => f.label === label).id;
await quack.invoke("tables.add", { docId, fieldIds: [id("Brand"), id("Net amount")] });
await quack.invoke("reports.save", { docId });
Tips for the agent
- Read
quack.help(id)before using a command for the first time. The examples are real inputs. - Call
reports.fieldsfor ids. Don’t guess them. - Check with
reports.resultsfor data andreports.inspectRenderingfor what is drawn. - An error’s
codesays what to do.invalid_inputlists the paths that were wrong. - Commands that change a draft are undo steps.
reports.undotakes one back.
Tips for you
- Give it a report in My reports to work in, then move it when you are happy.
- Watch as it goes.
Ctrl Zundoes its edits like yours. - Commands that delete or share things act with your permissions. Sign in as an editor if the agent has no need to be an admin.
- Commands can list and revoke API tokens. None can create or read one.
The areas covered are listed in Browser commands.