# Example Fire and Forget Extension

### Package.json

{% hint style="warning" %}
Note: do **not** name any file `main.swift` or `main.cs`
{% endhint %}

```json
{
  "name": "positron-plugin-toast",
  "version": "1.0.0",
  "positron": {
    "command": "toast:show",
    "className": "ToastPlugin",
    "platforms": {
      "darwin": "mac/Toast.swift",
      "win32": "win/Toast.cs"
    }
  }
}
```

### mac/Toast.swift

{% code lineNumbers="true" %}

```swift
import Cocoa

public class ToastPlugin {
        static func handle(windowId: Int, args: [String]) {
        let alert = NSAlert()
        alert.messageText = args.first ?? "Hello from Positron!"
        alert.runModal()
    }
}
```

{% endcode %}

### win/Toast.cs

{% code lineNumbers="true" %}

```csharp
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;

namespace PositronWindows
{
    public static class ToastPlugin
    {
        public static void Handle(int windowId, List<string> args)
        {
            string message = args.Count > 0 ? args[0] : "Hello from Positron!";
            
            Task.Run(() => 
            {
                MessageBox.Show(message, "Notification");
            });
        }
    }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://positronjs.gitbook.io/v1/extensions/create/example-fire-and-forget-extension.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
