@xnetjs/plugins 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,6 +18,7 @@ pnpm add @xnetjs/plugins
18
18
  - **Middleware chain** -- Composable middleware for plugin operations
19
19
  - **Extension context** -- Scoped API surface for plugins
20
20
  - **Plugin/Script schemas** -- Plugins and scripts stored as Nodes
21
+ - **Canvas contributions** -- Cards, ingestors, tools, layouts, edges, inspectors, templates, permission gates, sandbox policies, and development fixtures
21
22
  - **Sandboxed execution** -- Safe script execution with AST validation (acorn)
22
23
  - **Script runner** -- Execute validated scripts in a restricted context
23
24
  - **AI script generation** -- Generate scripts via Anthropic, OpenAI, or Ollama
@@ -102,6 +103,35 @@ shortcuts.register('mod+shift+t', () => openTaskPanel())
102
103
  shortcuts.register('mod+/', () => openSlashMenu())
103
104
  ```
104
105
 
106
+ ### Canvas Plugin Authoring
107
+
108
+ Canvas plugins can contribute provider-aware cards, URL/file ingestors, contextual tools, semantic edges, layouts, inspectors, and templates. See the full authoring guide: [Canvas Plugin Authoring](../../docs/reference/canvas-plugin-authoring.md).
109
+
110
+ ```typescript
111
+ import { defineExtension } from '@xnetjs/plugins'
112
+
113
+ export const crmCanvasPlugin = defineExtension({
114
+ id: 'com.example.crm-canvas',
115
+ name: 'CRM Canvas',
116
+ version: '1.0.0',
117
+ contributes: {
118
+ canvasCards: [
119
+ {
120
+ id: 'crm.account-card',
121
+ type: 'canvas.card',
122
+ name: 'Account Card',
123
+ schemaId: 'xnet://example.crm/account',
124
+ provider: 'crm',
125
+ canvasKinds: ['record', 'database-row'],
126
+ previewTiers: ['summary', 'thumbnail', 'shell'],
127
+ rendererEntrypoint: 'crm/cards/account.render',
128
+ previewEntrypoint: 'crm/cards/account.preview'
129
+ }
130
+ ]
131
+ }
132
+ })
133
+ ```
134
+
105
135
  ### Node.js Services
106
136
 
107
137
  ```typescript