@zaflun/lumio-agent-skill 0.1.0 → 0.2.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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  installSkillFiles
4
- } from "../chunk-I2USQPPS.js";
4
+ } from "../chunk-5NNQDQNL.js";
5
5
 
6
6
  // src/bin/lumio-skills.ts
7
7
  import { resolve } from "path";
@@ -61,9 +61,8 @@ All three surfaces share storage via \`useExtensionStorage()\` \u2014 changes in
61
61
 
62
62
  \`\`\`json
63
63
  {
64
- "$schema": "https://docs.lumio.vision/schemas/lumio.config.schema.json",
64
+ "$schema": "https://lumio.vision/schemas/lumio.config.schema.json",
65
65
  "extensionId": "uuid",
66
- "slug": "k8f2x-my-extension",
67
66
  "name": "My Extension",
68
67
  "description": "Description",
69
68
  "category": "widget",
@@ -77,12 +76,10 @@ All three surfaces share storage via \`useExtensionStorage()\` \u2014 changes in
77
76
  },
78
77
  "visibility": "public",
79
78
  "pricing": { "type": "free" },
80
- "config_schema": {
81
- "fields": [
82
- { "key": "title", "type": "string", "label": "Widget Title", "default": "My Widget" },
83
- { "key": "showBorder", "type": "boolean", "label": "Show Border", "default": true }
84
- ]
85
- }
79
+ "config_schema": [
80
+ { "key": "title", "type": "string", "label": "Widget Title", "default_value": "My Widget", "required": true },
81
+ { "key": "showBorder", "type": "boolean", "label": "Show Border", "default_value": true, "required": false }
82
+ ]
86
83
  }
87
84
  \`\`\`
88
85
 
@@ -164,7 +161,7 @@ See \`components.md\` for full props and examples.
164
161
  | \`useLumioConfig()\` | \`[config, setConfig]\` | Extension config read/write (uses config_schema fields) |
165
162
  | \`useLumioTheme()\` | \`theme\` | Current theme (dark/light/custom) |
166
163
  | \`useLumioIdentity()\` | \`{ userId, accountId, role }\` | Current user context |
167
- | \`useLumioAction(action, params)\` | \`{ execute, data, isLoading, error }\` | Trigger Lumio actions \u2014 type-safe: \`action\` is \`LumioActionType\` |
164
+ | \`useLumioAction(action)\` | \`{ execute, data, isLoading, error }\` | Trigger Lumio actions \u2014 type-safe: \`action\` is \`LumioActionType\` |
168
165
  | \`useQuery(fn, params?)\` | \`{ data, isLoading, error, refetch }\` | Call server query |
169
166
  | \`useMutation(fn)\` | \`{ mutate, mutateAsync, data, isLoading, error }\` | Call server mutation/action |
170
167
  | \`useAnimation(preset, options?)\` | \`animationProps\` | SDK animation presets for \`Animated\` component |
@@ -200,23 +197,23 @@ export const fetchScores = action({
200
197
  **Extension Actions** via \`useLumioAction()\` (21 total, \`action\` is \`LumioActionType\`):
201
198
  \`\`\`tsx
202
199
  // Trigger platform actions (requires matching permission in lumio.config.json)
203
- const { execute: sendChat } = useLumioAction("chat:send", {});
204
- const { execute: banUser } = useLumioAction("chat:ban", {});
205
- const { execute: unbanUser } = useLumioAction("chat:unban", {});
206
- const { execute: timeoutUser } = useLumioAction("chat:timeout", {});
207
- const { execute: setScene } = useLumioAction("obs:set_scene", {});
208
- const { execute: startRecording } = useLumioAction("obs:start_recording", {});
209
- const { execute: stopRecording } = useLumioAction("obs:stop_recording", {});
210
- const { execute: emitEvent } = useLumioAction("events:emit", {});
211
- const { execute: updateLayer } = useLumioAction("overlay:update_layer", {});
212
- const { execute: spotifyPlay } = useLumioAction("spotify:play", {});
213
- const { execute: spotifyPause } = useLumioAction("spotify:pause", {});
214
- const { execute: spotifySkip } = useLumioAction("spotify:skip", {});
215
- const { execute: spotifySeek } = useLumioAction("spotify:seek", {});
216
- const { execute: spotifyVolume } = useLumioAction("spotify:volume", {});
217
- const { execute: spotifyShuffle } = useLumioAction("spotify:shuffle", {});
218
- const { execute: spotifyRepeat } = useLumioAction("spotify:repeat", {});
219
- const { execute: spotifyQueueAdd } = useLumioAction("spotify:queue_add", {});
200
+ const { execute: sendChat } = useLumioAction("chat:send");
201
+ const { execute: banUser } = useLumioAction("chat:ban");
202
+ const { execute: unbanUser } = useLumioAction("chat:unban");
203
+ const { execute: timeoutUser } = useLumioAction("chat:timeout");
204
+ const { execute: setScene } = useLumioAction("obs:set_scene");
205
+ const { execute: startRecording } = useLumioAction("obs:start_recording");
206
+ const { execute: stopRecording } = useLumioAction("obs:stop_recording");
207
+ const { execute: emitEvent } = useLumioAction("events:emit");
208
+ const { execute: updateLayer } = useLumioAction("overlay:update_layer");
209
+ const { execute: spotifyPlay } = useLumioAction("spotify:play");
210
+ const { execute: spotifyPause } = useLumioAction("spotify:pause");
211
+ const { execute: spotifySkip } = useLumioAction("spotify:skip");
212
+ const { execute: spotifySeek } = useLumioAction("spotify:seek");
213
+ const { execute: spotifyVolume } = useLumioAction("spotify:volume");
214
+ const { execute: spotifyShuffle } = useLumioAction("spotify:shuffle");
215
+ const { execute: spotifyRepeat } = useLumioAction("spotify:repeat");
216
+ const { execute: spotifyQueueAdd } = useLumioAction("spotify:queue_add");
220
217
  \`\`\`
221
218
 
222
219
  See \`server-functions.md\` for schema definition, storage scoping, and advanced patterns.
@@ -307,7 +304,7 @@ addItem({ text: "New item" });
307
304
 
308
305
  ### Lumio actions
309
306
  \`\`\`tsx
310
- const { execute } = useLumioAction("chat:send", {});
307
+ const { execute } = useLumioAction("chat:send");
311
308
  execute({ message: "Hello from my extension!" });
312
309
  \`\`\`
313
310
 
@@ -775,15 +772,12 @@ For complex logic that cannot be expressed declaratively. Runs in V8 isolate san
775
772
  \`\`\`typescript
776
773
  import { query, mutation, action, v } from "@zaflun/lumio-sdk/server";
777
774
 
778
- // Read-only query
779
- export const getLeaderboard = query({
780
- args: { limit: v.number().optional() },
775
+ // Read-only query \u2014 look up a single row by ID
776
+ export const getScore = query({
777
+ args: { id: v.string() },
781
778
  handler: async (ctx, args) => {
782
- const rows = await ctx.db.get("scores", {
783
- order: { score: "desc" },
784
- limit: args.limit ?? 10,
785
- });
786
- return rows;
779
+ const row = await ctx.db.get("scores", args.id);
780
+ return row;
787
781
  },
788
782
  });
789
783
 
@@ -820,7 +814,7 @@ Handler-based functions run inside a V8 isolate Web Worker. The \`ctx\` object p
820
814
 
821
815
  | Property | Description |
822
816
  |----------|-------------|
823
- | \`ctx.db.get(table, options?)\` | Read rows from extension DB schema |
817
+ | \`ctx.db.get(table, id)\` | Read a single row by ID from extension DB schema |
824
818
  | \`ctx.db.insert(table, data)\` | Insert row |
825
819
  | \`ctx.db.patch(table, id, data)\` | Update row |
826
820
  | \`ctx.db.delete(table, id)\` | Delete row |
@@ -856,19 +850,19 @@ Extension Actions let extensions trigger Lumio platform capabilities on behalf o
856
850
  import { useLumioAction } from "@zaflun/lumio-sdk";
857
851
 
858
852
  // Send a chat message on the connected platform
859
- const { execute: sendChat, isLoading, error } = useLumioAction("chat:send", {});
853
+ const { execute: sendChat, isLoading, error } = useLumioAction("chat:send");
860
854
  sendChat({ message: "Hello from the extension!" });
861
855
 
862
856
  // Switch OBS scene (requires OBS WebSocket integration)
863
- const { execute: setScene } = useLumioAction("obs:set_scene", {});
857
+ const { execute: setScene } = useLumioAction("obs:set_scene");
864
858
  setScene({ sceneName: "Main Scene" });
865
859
 
866
860
  // Emit a custom event into the Lumio event bus
867
- const { execute: emitEvent } = useLumioAction("events:emit", {});
861
+ const { execute: emitEvent } = useLumioAction("events:emit");
868
862
  emitEvent({ type: "extension:custom", payload: { score: 42 } });
869
863
 
870
864
  // Update a specific layer in the overlay
871
- const { execute: updateLayer } = useLumioAction("overlay:update_layer", {});
865
+ const { execute: updateLayer } = useLumioAction("overlay:update_layer");
872
866
  updateLayer({ layerId: "uuid", visible: true });
873
867
  \`\`\`
874
868
 
@@ -877,10 +871,14 @@ updateLayer({ layerId: "uuid", visible: true });
877
871
  | Action | Permission required | Description |
878
872
  |--------|--------------------|----|
879
873
  | \`chat:send\` | \`chat:send\` | Send chat message on connected platform |
874
+ | \`chat:delete\` | \`chat:delete\` | Delete a chat message |
880
875
  | \`chat:ban\` | \`chat:ban\` | Ban a user from chat |
881
876
  | \`chat:unban\` | \`chat:ban\` | Unban a user from chat |
882
877
  | \`chat:timeout\` | \`chat:ban\` | Timeout a user from chat |
883
878
  | \`obs:set_scene\` | \`obs:control\` | Switch OBS scene |
879
+ | \`obs:set_source_visible\` | \`obs:control\` | Show or hide an OBS source |
880
+ | \`obs:start_stream\` | \`obs:control\` | Start OBS streaming |
881
+ | \`obs:stop_stream\` | \`obs:control\` | Stop OBS streaming |
884
882
  | \`obs:start_recording\` | \`obs:control\` | Start OBS recording |
885
883
  | \`obs:stop_recording\` | \`obs:control\` | Stop OBS recording |
886
884
  | \`events:emit\` | \`events:write\` | Emit event into Lumio event bus |
@@ -1325,7 +1323,7 @@ Data is scoped to a specific extension installation within a specific overlay.
1325
1323
  defineTable({...}).storage("instance")
1326
1324
  \`\`\`
1327
1325
 
1328
- - Filtered by: \`_account_id\` + \`_overlay_id\`
1326
+ - Filtered by: \`_account_id\` + \`_overlay_id\` + \`_install_id\`
1329
1327
  - Use for: per-widget data (scoreboard scores, timer state, per-overlay config)
1330
1328
  - Example: A "Sports Scoreboard" widget has different scores in each overlay it appears in
1331
1329
 
@@ -1383,7 +1381,7 @@ Each scope maps to automatic WHERE clauses:
1383
1381
 
1384
1382
  \`\`\`sql
1385
1383
  -- instance scope:
1386
- SELECT * FROM ext_{id}.items WHERE _account_id = $1 AND _overlay_id = $2
1384
+ SELECT * FROM ext_{id}.items WHERE _account_id = $1 AND _overlay_id = $2 AND _install_id = $3
1387
1385
 
1388
1386
  -- overlay scope:
1389
1387
  SELECT * FROM ext_{id}.items WHERE _account_id = $1 AND _overlay_id = $2
@@ -1485,23 +1483,19 @@ Use \`config_schema\` in \`lumio.config.json\` for user-customizable settings. T
1485
1483
 
1486
1484
  \`\`\`json
1487
1485
  {
1488
- "config_schema": {
1489
- "fields": [
1490
- { "key": "title", "type": "string", "label": "Widget Title", "default": "My Widget" },
1491
- { "key": "maxItems", "type": "number", "label": "Max Items", "default": 10 },
1492
- { "key": "showBorder", "type": "boolean", "label": "Show Border", "default": true },
1493
- {
1494
- "key": "theme",
1495
- "type": "select",
1496
- "label": "Color Theme",
1497
- "options": [
1498
- { "label": "Dark", "value": "dark" },
1499
- { "label": "Light", "value": "light" }
1500
- ],
1501
- "default": "dark"
1502
- }
1503
- ]
1504
- }
1486
+ "config_schema": [
1487
+ { "key": "title", "type": "string", "label": "Widget Title", "default_value": "My Widget", "required": true },
1488
+ { "key": "maxItems", "type": "number", "label": "Max Items", "default_value": 10, "required": false },
1489
+ { "key": "showBorder", "type": "boolean", "label": "Show Border", "default_value": true, "required": false },
1490
+ {
1491
+ "key": "theme",
1492
+ "type": "select",
1493
+ "label": "Color Theme",
1494
+ "options": ["dark", "light"],
1495
+ "default_value": "dark",
1496
+ "required": false
1497
+ }
1498
+ ]
1505
1499
  }
1506
1500
  \`\`\`
1507
1501
 
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  ROOT_FILES,
3
3
  SKILL_FILES,
4
4
  installSkillFiles
5
- } from "./chunk-I2USQPPS.js";
5
+ } from "./chunk-5NNQDQNL.js";
6
6
  export {
7
7
  ROOT_FILES,
8
8
  SKILL_FILES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaflun/lumio-agent-skill",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "AI agent skill files for building Lumio Extensions",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",