Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
5b18890
fix(skills): show SKILL.md folders placed in a bot's skills folder
SiddDevZ Dec 4, 2026
8c9bc67
feat(agents): manage_bot_skills lets a bot set another owned bot's sk…
SiddDevZ Dec 4, 2026
0e498fa
bots change dusk for their owner: manage_dusk and sibling routines on…
SiddDevZ Dec 4, 2026
ecf4a0a
bots decide reversible choices themselves at the default level
SiddDevZ Dec 4, 2026
d30d3d4
Merge remote-tracking branch 'origin/feat/bots-run-dusk' into feat/bo…
SiddDevZ Dec 4, 2026
112f468
Merge skills-from-folder and bots-run-dusk: manage_bot_skills uses th…
SiddDevZ Dec 4, 2026
eff03be
behaviour eval: the artifacts suite runs the real artifact tools agai…
SiddDevZ Dec 4, 2026
2fef4c6
artifacts only when needed: create_artifact names what earns one (an …
SiddDevZ Dec 4, 2026
edf066a
behaviour eval: fake artifacts service checks the bearer with startsWith
SiddDevZ Dec 4, 2026
39ca113
artifacts web: an app frame in the editor gets the per-artifact pseud…
SiddDevZ Dec 4, 2026
4f8ef4e
behaviour eval: parallel runs retry a taken proxy port; an artifacts …
SiddDevZ Dec 4, 2026
3480c68
artifacts: sign-up invite mails wait for a day-old account, cap at 10…
SiddDevZ Dec 4, 2026
53d730e
artifacts: only day-old accounts on different /24 or /48 networks cou…
SiddDevZ Dec 4, 2026
bb2ac15
artifacts: a static path with a broken percent escape is a 404, not a…
SiddDevZ Dec 4, 2026
8af9613
artifacts: the HTML export runs the WebRTC guard before any of the ap…
SiddDevZ Dec 4, 2026
8848aec
artifacts: artifacts-preview.dusk.bot is no built-in shim parent; pre…
SiddDevZ Dec 4, 2026
c2fe822
artifacts: the artifact frame gets no fullscreen or clipboard-write, …
SiddDevZ Dec 4, 2026
17f02a6
artifacts: one live connection holds at most four presence entries, a…
SiddDevZ Dec 4, 2026
dc05d54
decide-it-yourself only answers the bot's own ask_user choices
SiddDevZ Dec 4, 2026
5e5fe6a
artifacts web: opening an artifact stays on the latest version as new…
SiddDevZ Dec 4, 2026
a1d540a
artifacts web: a live doc shows its page's shape while it connects in…
SiddDevZ Dec 4, 2026
63e059b
artifacts web: invites that wait for consent show as rows above Recen…
SiddDevZ Dec 4, 2026
1a09acf
artifacts: an image written over the live socket that cleanDoc would …
SiddDevZ Dec 4, 2026
61b7c39
artifacts: the sign-in code redeem carries the state it was minted fo…
SiddDevZ Dec 4, 2026
f9fdd9f
artifacts web: the version crossfade's short wait before the new cont…
SiddDevZ Dec 4, 2026
34669ac
artifacts: an artifacts session is bound to the dusk bot web sign-in …
SiddDevZ Dec 4, 2026
aaacea1
artifacts: rate limits count fixed windows in MongoDB too (artifact_r…
SiddDevZ Dec 4, 2026
364d696
behaviour eval: artifacts round results on gpt-6.2-sol, 2 runs per ca…
SiddDevZ Dec 4, 2026
4aac165
artifacts web: the list header fits a 320px phone (New keeps its plus…
SiddDevZ Dec 4, 2026
8529f0d
routines run and report in the bot's starred chat
SiddDevZ Dec 4, 2026
293d80d
routine runs learn from the person's corrections and their own failures
SiddDevZ Dec 4, 2026
56606ed
artifacts on: create_document sends a multi-page plan, report or hand…
SiddDevZ Dec 4, 2026
dd1e500
artifacts web: the version label stays plain on the latest when saves…
SiddDevZ Dec 4, 2026
e61d5bd
artifacts link test: read the account answer through a typed helper
SiddDevZ Dec 4, 2026
a3a5f37
routines: results read as the bot's main chat; the phone's Open resul…
SiddDevZ Dec 4, 2026
14d7622
model picker: after a provider failure the chat reads as on its own m…
SiddDevZ Dec 4, 2026
6b76668
Merge remote-tracking branch 'origin/fix/routine-learns-from-chat' in…
SiddDevZ Dec 4, 2026
66654db
Merge remote-tracking branch 'origin/fix/one-main-chat' into fix/no-a…
SiddDevZ Dec 4, 2026
0750042
artifact card: a doc's opening sits on its own page tone inside the c…
SiddDevZ Dec 4, 2026
2add4f0
settings: an Artifacts row whose title reads right to left keeps it b…
SiddDevZ Dec 4, 2026
0cc66f5
tests: the chat gallery has an artifacts scenario (made, updated, an …
SiddDevZ Dec 4, 2026
571280b
routines: one job is one automation, bots tidy their own without asking
SiddDevZ Dec 4, 2026
facaef3
artifact card: the newest save's pop plays on the card itself when it…
SiddDevZ Dec 4, 2026
c8c59df
artifacts: an invite waits for its person to accept (GET /v1/artifact…
SiddDevZ Dec 4, 2026
ea733d3
routines: a secret in a correction goes to the Vault, the instruction…
SiddDevZ Dec 4, 2026
9c60547
artifacts web: the doc's own notices (isn't connecting, can't open) u…
SiddDevZ Dec 4, 2026
55bbe2f
artifacts on by default: DUSK_ARTIFACTS=0 is the off switch for the h…
SiddDevZ Dec 4, 2026
155a63b
artifacts web: a doc's page and an app's preview take over from their…
SiddDevZ Dec 4, 2026
8381d96
artifacts deploy check: the artifacts service needs its account URL, …
SiddDevZ Dec 4, 2026
791d5b6
docs/artifacts: the switch is on by default with DUSK_ARTIFACTS=0 to …
SiddDevZ Dec 4, 2026
06f9fae
Merge remote-tracking branch 'origin/feat/artifacts-polish' into fix/…
SiddDevZ Dec 4, 2026
ecc06f0
artifacts: a doc version whose content matches the latest one is that…
SiddDevZ Dec 4, 2026
3d37d5a
fix(cloud updates): a run that failed for its task never counts again…
SiddDevZ Dec 4, 2026
2bb3e30
routines: delete_trigger stays listed for bridged engines, tests follow
SiddDevZ Dec 4, 2026
509af48
Merge remote-tracking branch 'origin/fix/update-trial-task-failures' …
SiddDevZ Dec 4, 2026
9468810
routines e2e: a trickle ends as one routine, a change updates in plac…
SiddDevZ Dec 4, 2026
40be8ef
artifacts: the pointers are added by one helper beside the artifact t…
SiddDevZ Dec 4, 2026
b55f7ed
Merge remote-tracking branch 'origin/feat/artifacts-when-needed' into…
SiddDevZ Dec 4, 2026
b6d1da1
release: 0.2.41 changelog
SiddDevZ Dec 4, 2026
fd545f9
docs: the verification fixture's Artifacts switch is on by default wi…
SiddDevZ Dec 4, 2026
463d19e
Merge remote-tracking branch 'origin/feat/artifacts-live' into fix/no…
SiddDevZ Dec 4, 2026
aabb5aa
Merge remote-tracking branch 'origin/dev' into routines-push
SiddDevZ Dec 4, 2026
d3a50db
routines eval: before and after, three runs each
SiddDevZ Dec 4, 2026
155999a
artifacts web: pending invites use the real consent API (GET /v1/arti…
SiddDevZ Dec 4, 2026
24e6d8c
Merge remote-tracking branch 'origin/fix/routines-one-and-tidy' into …
SiddDevZ Dec 4, 2026
c83d33b
tests: app-triggers checks the plain-words rule where it lives, on th…
SiddDevZ Dec 4, 2026
414b866
Merge remote-tracking branch 'origin/main' into fix/no-account-row
SiddDevZ Dec 4, 2026
5f1cf8b
release: 0.2.42 (one main chat, routines that learn and tidy up, Vaul…
SiddDevZ Dec 4, 2026
a31aa18
release notes: 0.2.42 leaves artifacts out until artifacts.dusk.bot i…
SiddDevZ Dec 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/artifacts/e2e/attack-pages/11-other-artifacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
report("broadcast", !heard, heard ? "heard another artifact" : "nothing heard");
report("storage.own", Object.keys(localStorage).join(",") === "mine", Object.keys(localStorage).join(","));
}, 2000);
report("user.pseudonymous", Boolean(dusk.user) && dusk.user.id === "u_e2e_pseudonym" && !("email" in dusk.user), JSON.stringify(dusk.user));
report("user.pseudonymous", Boolean(dusk.user) && JSON.stringify(Object.keys(dusk.user).sort()) === '["id","name","role"]' && dusk.user.id === "u_e2e_pseudonym" && dusk.user.name === "Someone" && dusk.user.role === "viewer", JSON.stringify(dusk.user));
</script>
3 changes: 2 additions & 1 deletion apps/artifacts/e2e/parent-entry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// The attack suite's stand-in for the artifacts shell: mounts an attack page through the real bridge host. Every
// download and link ask is recorded and refused, as if the person never clicked.
import { mountArtifactFrame, type ArtifactFrame } from "../web/src/lib/bridge-host.ts";
import { frameUser } from "../web/src/lib/frame-user.ts";
import type { ShimNote } from "../../../shared/artifacts-bridge.ts";

interface E2eState {
Expand All @@ -25,7 +26,7 @@ const mount = (index: number, source: string) => {
return mountArtifactFrame({
container,
usercontent,
load: { format: "html", source, title: `attack ${attack}`, theme: "light", caps: ["downloads", "links", "user"], user: { id: "u_e2e_pseudonym", name: "Test Viewer", role: "viewer" } },
load: { format: "html", source, title: `attack ${attack}`, theme: "light", caps: ["downloads", "links", "user"], user: frameUser({ id: "u_e2e_pseudonym", role: "viewer" }) },
onNote: (note) => state.notes.push({ frame: index, note }),
confirmDownload: async (ask) => { state.asks.push({ kind: "download", detail: ask }); return false; },
confirmLink: async (url) => { state.asks.push({ kind: "link", detail: url }); return false; },
Expand Down
151 changes: 138 additions & 13 deletions apps/artifacts/server/app.test.ts

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions apps/artifacts/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { readFile, stat } from "node:fs/promises";
import type { IncomingMessage, ServerResponse } from "node:http";
import type { Duplex } from "node:stream";
import { extname, join, normalize, resolve, sep } from "node:path";
import { clientIp, rateIp } from "../../dashboard/server/client-ip.ts";
import { clientIp, networkIp, rateIp } from "../../dashboard/server/client-ip.ts";
import type { ObjectStore } from "../../dashboard/server/pages/object-store.ts";
import { adminRoutes } from "./admin/routes.ts";
import { artifactRoutes } from "./artifacts/routes.ts";
Expand Down Expand Up @@ -57,7 +57,7 @@ export function createArtifactsApp(options: AppOptions) {
const { config, repo } = options;
const log = options.log ?? (line => console.warn(line));
const now = options.now ?? Date.now;
const limiter = options.limiter ?? createLimiter(now);
const limiter = options.limiter ?? createLimiter(now, (id, windowEndsAt) => repo.hitRate(id, windowEndsAt), log);
const sessions = createSessions({ repo, secret: config.sessionSecret, secure: config.publicUrl.startsWith("https:"), accounts: options.accounts, now, log });
const liveTokens = createLiveTokens(config.sessionSecret, now);
const service = createArtifactService({ repo, objects: options.objects, docs: options.docs({ cutDocVersion: (id, version) => service.cutDocVersion(id, version) }), limiter, publicUrl: config.publicUrl, secret: config.sessionSecret,
Expand Down Expand Up @@ -85,11 +85,13 @@ export function createArtifactsApp(options: AppOptions) {
const usercontentMeta = `${config.usercontentMode} ${config.usercontentOrigin}`.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");

function context(req: IncomingMessage, res: ServerResponse, url: URL): Ctx {
const ipHash = createHmac("sha256", config.sessionSecret).update(`ip:${rateIp(clientIp(req, config.trustProxy))}`).digest("base64url").slice(0, 22);
const ip = clientIp(req, config.trustProxy);
const ipHash = createHmac("sha256", config.sessionSecret).update(`ip:${rateIp(ip)}`).digest("base64url").slice(0, 22);
const networkHash = createHmac("sha256", config.sessionSecret).update(`net:${networkIp(ip)}`).digest("base64url").slice(0, 22);
let signed: Promise<SignedIn | null> | null = null;
let parsed: Promise<Record<string, unknown>> | null = null;
const personOf = (found: SignedIn): Viewer => ({ accountId: found.account._id, email: found.account.email, kind: "person", ipHash, account: found.account });
const anon: Viewer = { accountId: null, email: null, kind: "anon", ipHash };
const personOf = (found: SignedIn): Viewer => ({ accountId: found.account._id, email: found.account.email, kind: "person", ipHash, networkHash, account: found.account });
const anon: Viewer = { accountId: null, email: null, kind: "anon", ipHash, networkHash };
const sameOrigin = () => {
if (req.headers.origin !== config.publicUrl) fail(403, "forbidden", "Request is not allowed.");
// a body must be JSON; a bodiless POST (restore, view) is covered by the Origin check and, signed in, the CSRF header
Expand Down Expand Up @@ -123,7 +125,7 @@ export function createArtifactsApp(options: AppOptions) {
const body = await ctx.body(BOT_BODY_PREVIEW);
if (typeof body.botName === "string") botName = body.botName.replace(/\s+/g, " ").trim().slice(0, 60) || undefined;
}
return { accountId: check.payload.sub, email: account?.email || null, kind: "bot", ipHash, account, ...(botName ? { botName } : {}) };
return { accountId: check.payload.sub, email: account?.email || null, kind: "bot", ipHash, networkHash, account, ...(botName ? { botName } : {}) };
},
body: (maxBytes = 64 * 1024) => (parsed ??= Number(req.headers["content-length"] ?? 0) > 0 || req.headers["transfer-encoding"] !== undefined ? readJson(req, maxBytes) : Promise.resolve({})),
};
Expand All @@ -132,7 +134,9 @@ export function createArtifactsApp(options: AppOptions) {

async function serveStatic(req: IncomingMessage, res: ServerResponse, path: string): Promise<boolean> {
if (!staticRoot || (req.method !== "GET" && req.method !== "HEAD")) return false;
let target = normalize(join(staticRoot, decodeURIComponent(path)));
let decoded: string;
try { decoded = decodeURIComponent(path); } catch { return false; }
let target = normalize(join(staticRoot, decoded));
if (target !== staticRoot && !target.startsWith(staticRoot + sep)) return false;
let info = await stat(target).catch(() => null);
if (!info?.isFile()) {
Expand Down
9 changes: 5 additions & 4 deletions apps/artifacts/server/artifacts/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export function artifactRoutes(deps: Deps): Route<Ctx>[] {
const viewer = await ctx.viewer();
const { record, role, member } = await service.open(id!, viewer);
const number = intParam(n, "version")!;
const pinned = service.viewVersion(record, role);
if (pinned !== undefined && pinned !== number) fail(404, "not_found", "That version does not exist.");
const shown = await service.shownVersion(record, role);
if (shown !== null && shown !== number) fail(404, "not_found", "That version does not exist.");
const version = await deps.repo.getVersion(record._id, number);
if (!version) fail(404, "not_found", "That version does not exist.");
const { content, pm } = await service.contentOf(record, number);
Expand Down Expand Up @@ -130,8 +130,9 @@ export function artifactRoutes(deps: Deps): Route<Ctx>[] {
const { record, role } = await service.open(id!, viewer);
if (!deps.limiter.hit("exports", viewer.accountId ?? viewer.ipHash)) fail(429, "rate_limited", "Too many downloads. Try again in a little while.");
const format = (ctx.url.searchParams.get("as") ?? ctx.url.searchParams.get("format") ?? (record.kind === "app" ? "html" : "md")) as ExportFormat;
const pinned = service.viewVersion(record, role);
const n = pinned ?? intParam(ctx.url.searchParams.get("n") ?? ctx.url.searchParams.get("version"), "version");
// anyone below editor downloads only the version they see; ?n= picks from the history only for editors
const shown = await service.shownVersion(record, role);
const n = shown !== null ? shown : intParam(ctx.url.searchParams.get("n") ?? ctx.url.searchParams.get("version"), "version");
const file = await exportFile(deps, record, format, n);
sendBytes(ctx.res, 200, file.body, { "content-type": file.mime, "content-disposition": disposition(file.name), "x-content-type-options": "nosniff",
"content-security-policy": "default-src 'none'; sandbox" });
Expand Down
Loading
Loading