Something went wrong. Try again.
Monorepo for the nibling.run platform
Something went wrong. Try again.
12345678910111213141516171819import "../src/code/element.ts";import { agentControls, editor, playground } from "./peers.ts";
const SAMPLE = `import { Doc } from "@nibling/app/collab";
/** Says hello to everyone editing this file. */export function greet(names: string[]): string { const list = names.length > 1 ? \`\${names.slice(0, -1).join(", ")} and \${names.at(-1)}\` : names[0]; return \`Hello, \${list ?? "nobody"}!\`;}
const doc = Doc.create(greet(["Ada", "Grace"]));console.log(doc.text);`;
const agent = playground("nib-code:playground", SAMPLE, { Ada: editor("nib-code", "ada"), Grace: editor("nib-code", "grace") });
agentControls(agent, (text) => text.replaceAll(/\bgreet\b/g, "welcome"));