Examples
Start with the smallest example that matches your task. The linked guides own the complete code and its API explanation; this page is the index, so you do not have to reconcile another copy of the same extension.
Choose a starting point
Section titled “Choose a starting point”| You need | Example | Host boundary |
|---|---|---|
| A page and fast edit/reload loop | Reading List quickstart | Desktop authoring through the public CLI |
| A stored task list | Typed data worked example | SQLite belongs to the engine profile; the example uses Desktop UI hooks |
| Recurring agent work | Agent cron trigger | Owning engine must stay running and its host must run schedules |
| Tools without a page | Tool pack | Main/server code; no renderer required |
| A view inside a session workspace | Session dock view | Read workspace.authority; Desktop cloud sessions do not expose sandbox paths |
| A website using WAMP organization identity | Sign in with WAMP | OIDC authorization code + PKCE, with tokens verified by your backend |
| AI in a product outside the WAMP shell | Your own backend | HTTP AI proxy, app installation credentials, optional end-user tokens |
The CLI’s minimal template scaffolds a page. Its full template adds typed
data, notifications, a tool, and a one-off AI action that can call it. Both
work from an ordinary
workspace with the published SDK; see CLI availability and installation.
Minimal tool extension
Section titled “Minimal tool extension”These two files expose a read-only word-count tool. They demonstrate the
boundary between a manifest contribution and its executable registration:
metadata labels the tool; tools.register supplies its schema and handler.
Place them in a text-metrics extension directory using the
quickstart installation path.
{ "name": "Text Metrics", "version": "1.0.0", "main": "dist/main.js", "activationEvents": ["onStartupFinished"], "contributes": { "toolMetadata": [ { "id": "text_metrics_words", "label": "Count words", "readOnly": true } ] }}import type { PluginContext } from '@wamp/extension-sdk';
export async function activate(ctx: PluginContext): Promise<void> { ctx.api.disposables.add(ctx.api.tools.register({ name: 'text_metrics_words', description: 'Count whitespace-separated words in text. Returns a JSON word count.', inputSchema: { type: 'object', properties: { text: { type: 'string', maxLength: 100_000 } }, required: ['text'], additionalProperties: false, }, policy: { readOnly: true, parallelSafe: true }, execute: async (input) => { const text = String(input.text).trim(); return JSON.stringify({ words: text ? text.split(/\s+/u).length : 0 }); }, }));}Build and link the extension from its workspace with wamp ext dev. To supply
custom build logic or a separate server entry, use
Extensions and apps. Registration makes the tool
available to the host registry; an agent’s tool selection still determines
whether that agent can call it.