@sirenodeck/sirenodeck 0.1.1-alpha.0 → 0.2.2

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.
Files changed (84) hide show
  1. package/LICENSE +674 -21
  2. package/bin/dev.js +12 -2
  3. package/dist/main.mjs +3655 -1657
  4. package/package.json +18 -16
  5. package/src/api/protocol-internal.ts +16 -1
  6. package/src/assets/logo.png +0 -0
  7. package/src/assets/logo72x72.png +0 -0
  8. package/src/builtin-addons/brightness/buttons/brightness/config.ts +12 -2
  9. package/src/builtin-addons/coding-agents/buttons/agent/config.ts +5 -1
  10. package/src/builtin-addons/coding-agents/buttons/summary/config.ts +15 -3
  11. package/src/builtin-addons/coding-agents/buttons/summary/frontend.tsx +3 -3
  12. package/src/builtin-addons/coding-agents/global/backend.ts +56 -34
  13. package/src/builtin-addons/coding-agents/providers/opencode.ts +4 -5
  14. package/src/builtin-addons/core/buttons/action/config.ts +5 -2
  15. package/src/builtin-addons/core/buttons/change-deck/config.ts +6 -3
  16. package/src/builtin-addons/core/buttons/media-sample/config.ts +2 -2
  17. package/src/builtin-addons/core/buttons/toggle/config.ts +26 -9
  18. package/src/builtin-addons/date-time/buttons/custom/config.ts +5 -1
  19. package/src/builtin-addons/date-time/buttons/date/config.ts +2 -2
  20. package/src/builtin-addons/date-time/buttons/time/config.ts +5 -1
  21. package/src/builtin-addons/emoji-selector/buttons/category/config.ts +3 -3
  22. package/src/builtin-addons/emoji-selector/buttons/emoji/config.ts +5 -2
  23. package/src/builtin-addons/emoji-selector/support.ts +5 -2
  24. package/src/builtin-addons/global-services.ts +23 -0
  25. package/src/builtin-addons/internal-settings/buttons/app-info/config.ts +2 -1
  26. package/src/builtin-addons/internal-settings/buttons/brightness-down/config.ts +6 -1
  27. package/src/builtin-addons/internal-settings/buttons/brightness-up/config.ts +6 -1
  28. package/src/builtin-addons/media/backend.ts +54 -0
  29. package/src/builtin-addons/media/buttons/volume/volume-down/config.ts +1 -1
  30. package/src/builtin-addons/media/buttons/volume/volume-up/config.ts +1 -1
  31. package/src/builtin-addons/session/buttons/time/config.ts +1 -1
  32. package/src/builtin-addons/system-status/buttons/system-status/schemas.ts +32 -6
  33. package/src/builtin-addons/system-status/manifest.ts +49 -0
  34. package/src/builtin-addons/value-display/buttons/value-display/config.ts +23 -9
  35. package/src/builtin-addons/weather/buttons/weather/config.ts +11 -6
  36. package/src/cli/coding-agents-onboarding.ts +181 -34
  37. package/src/cli/commands/command-executor.ts +61 -0
  38. package/src/cli/commands/emulator-mode.ts +17 -2
  39. package/src/cli/commands/network-bind.ts +13 -9
  40. package/src/cli/commands/restart.ts +15 -5
  41. package/src/cli/commands/run.ts +174 -317
  42. package/src/cli/commands/service/render-template.ts +10 -0
  43. package/src/cli/commands/skills.ts +106 -0
  44. package/src/cli/commands/start.ts +39 -9
  45. package/src/cli/commands/stop.ts +3 -2
  46. package/src/cli/commands/system-requirements.ts +1 -0
  47. package/src/cli/index.ts +16 -3
  48. package/src/cli/main.ts +15 -2
  49. package/src/cli/package-manager.ts +6 -0
  50. package/src/cli/skills-first-run.ts +46 -0
  51. package/src/cli/startup-display.ts +35 -17
  52. package/src/config/mutation.ts +13 -1
  53. package/src/config/schemas.ts +3 -3
  54. package/src/config/validation.ts +7 -1
  55. package/src/core/icon-asset-registry.ts +11 -6
  56. package/src/deck/addon-handler-bridge.ts +246 -176
  57. package/src/deck/deck-config.ts +11 -2
  58. package/src/deck/deck-presentation-publisher.ts +116 -0
  59. package/src/deck/index.ts +13 -0
  60. package/src/deck/inject-config-ui-button.ts +23 -0
  61. package/src/deck/methods.ts +23 -0
  62. package/src/deck/position-settings-version-button.ts +20 -0
  63. package/src/deck/runtime/host-policy-coordinator.ts +186 -0
  64. package/src/deck/runtime/runtime.ts +123 -250
  65. package/src/deck/system-back-injection.ts +2 -1
  66. package/src/device/reconnecting.ts +8 -1
  67. package/src/index.ts +1 -2
  68. package/src/outputClient/emulator.ts +13 -0
  69. package/src/outputClient/index.ts +8 -0
  70. package/src/outputClient/real.ts +40 -45
  71. package/src/outputClient/remote-mirror.ts +77 -0
  72. package/src/outputClient/types.ts +2 -0
  73. package/src/render/editor-handler.ts +12 -1
  74. package/src/render/frontend-bridge-url.ts +10 -0
  75. package/src/render/push-startup-screen.ts +76 -0
  76. package/src/render/ws-bridge.ts +2 -0
  77. package/src/system/providers/active-app/capture-file.ts +61 -0
  78. package/src/system/providers/active-app/wayland-gnome.ts +26 -10
  79. package/src/system/providers/active-app.ts +6 -0
  80. package/src/system/providers/clipboard/darwin.ts +28 -4
  81. package/src/system/providers/url.ts +57 -0
  82. package/src/util/logger.ts +19 -3
  83. package/src/version.ts +3 -1
  84. package/src/vite/virtual-modules.ts +12 -6
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@sirenodeck/sirenodeck",
3
- "version": "0.1.1-alpha.0",
3
+ "version": "0.2.2",
4
4
  "description": "CLI for managing Elgato Stream Deck devices via a config-driven deck system.",
5
+ "homepage": "https://deck.sireno.dev",
5
6
  "bugs": {
6
7
  "url": "https://github.com/sergiocarracedo/sireno-deck/issues"
7
8
  },
8
- "license": "MIT",
9
+ "license": "GPL-3.0-or-later",
9
10
  "repository": {
10
11
  "type": "git",
11
12
  "url": "git+https://github.com/sergiocarracedo/sireno-deck.git",
@@ -80,11 +81,23 @@
80
81
  "publishConfig": {
81
82
  "access": "public"
82
83
  },
84
+ "scripts": {
85
+ "dev": "node bin/dev.js",
86
+ "start": "node --import tsx src/cli/main.ts",
87
+ "build": "tsdown",
88
+ "build:frontend": "vite --config frontend/vite.build.config.ts build",
89
+ "build:config-ui": "vite --config config-ui/vite.config.ts build",
90
+ "prepublishOnly": "tsdown",
91
+ "test": "vitest run",
92
+ "typecheck": "tsc -p tsconfig.json --noEmit",
93
+ "lint": "oxlint src",
94
+ "format": "oxfmt src"
95
+ },
83
96
  "dependencies": {
84
97
  "@clack/prompts": "^1.0.0",
85
98
  "@elgato-stream-deck/node": "^7.6.3",
86
- "@heroui/react": "3.0.0-rc.1",
87
- "@heroui/styles": "3.0.0-rc.1",
99
+ "@heroui/react": "3.2.6",
100
+ "@heroui/styles": "3.2.6",
88
101
  "@meteocons/svg-static": "^0.1.0",
89
102
  "chokidar": "^5.0.0",
90
103
  "dbus-next": "^0.10.2",
@@ -125,16 +138,5 @@
125
138
  "typescript": "7.0.1-rc",
126
139
  "vite": "^8.0.0",
127
140
  "vitest": "^4.1.9"
128
- },
129
- "scripts": {
130
- "dev": "node bin/dev.js",
131
- "start": "node --import tsx src/cli/main.ts",
132
- "build": "tsdown",
133
- "build:frontend": "vite --config frontend/vite.build.config.ts build",
134
- "build:config-ui": "vite --config config-ui/vite.config.ts build",
135
- "test": "vitest run",
136
- "typecheck": "tsc -p tsconfig.json --noEmit",
137
- "lint": "oxlint src",
138
- "format": "oxfmt src"
139
141
  }
140
- }
142
+ }
@@ -404,6 +404,18 @@ export const editorStateMessageSchema = baseServerMessage
404
404
  themes: z.array(
405
405
  z.object({ name: z.string(), active: z.boolean().optional() }).strict(),
406
406
  ),
407
+ themeVariants: z
408
+ .record(
409
+ z.string(),
410
+ z
411
+ .object({
412
+ background: z.string(),
413
+ border: z.string(),
414
+ foreground: z.string(),
415
+ })
416
+ .strict(),
417
+ )
418
+ .default({}),
407
419
  buttonSchemas: z
408
420
  .record(z.string(), z.record(z.string(), z.unknown()))
409
421
  .default({}),
@@ -465,7 +477,7 @@ export const editorAssetWriteMessageSchema = baseClientMessage
465
477
  requestId: z.string().min(1),
466
478
  revision: z.number().int().nonnegative(),
467
479
  filename: z.string().min(1).max(255),
468
- data: z.string().min(1),
480
+ data: z.string().min(1).max(2_666_668),
469
481
  })
470
482
  .strict()
471
483
 
@@ -508,6 +520,9 @@ export const addonsInventoryMessageSchema = baseServerMessage
508
520
  internal: z.boolean().default(false),
509
521
  generated: z.boolean().default(false),
510
522
  defaultConfig: z.unknown().optional(),
523
+ gestureHandlers: z
524
+ .array(z.enum(["tap", "dbl-tap", "hold"]))
525
+ .optional(),
511
526
  })
512
527
  .strict(),
513
528
  ),
Binary file
Binary file
@@ -2,8 +2,18 @@ import { z } from "zod"
2
2
 
3
3
  export const configSchema = z
4
4
  .object({
5
- action: z.enum(["up", "down", "set"]).optional().default("up"),
6
- value: z.number().int().min(0).max(100).optional(),
5
+ action: z
6
+ .enum(["up", "down", "set"])
7
+ .optional()
8
+ .default("up")
9
+ .meta({ title: "Brightness action" }),
10
+ value: z
11
+ .number()
12
+ .int()
13
+ .min(0)
14
+ .max(100)
15
+ .optional()
16
+ .meta({ title: "Brightness (%)" }),
7
17
  })
8
18
  .strict()
9
19
 
@@ -6,7 +6,11 @@ export const configSchema = z
6
6
  // is resolved from the live snapshot (agentAtSlot). Explicit
7
7
  // providerId/sessionId pinning was never reachable (button ids are
8
8
  // positional), so it's gone.
9
- slot: z.number().int().min(0).default(0),
9
+ slot: z.number().int().min(0).default(0).meta({
10
+ title: "Agent slot",
11
+ description:
12
+ "Zero-based position in the generated session deck. Slot 0 is the first discovered session; slots are assigned dynamically, so they are not fixed to a provider or session ID.",
13
+ }),
10
14
  })
11
15
  .strict()
12
16
 
@@ -2,9 +2,21 @@ import { z } from "zod"
2
2
 
3
3
  export const configSchema = z
4
4
  .object({
5
- showCount: z.boolean().default(true),
6
- attentionOnly: z.boolean().default(false),
7
- fallingLetters: z.boolean().default(true),
5
+ showCount: z.boolean().default(true).meta({
6
+ title: "Show count",
7
+ description:
8
+ "Show the number of discovered agent sessions on the summary tile.",
9
+ }),
10
+ attentionOnly: z.boolean().default(false).meta({
11
+ title: "Attention only",
12
+ description:
13
+ "Show the attention state only when a session needs attention; otherwise show the normal summary.",
14
+ }),
15
+ fallingLetters: z.boolean().default(true).meta({
16
+ title: "Falling letters",
17
+ description:
18
+ "Show the animated falling-letter background on the summary tile.",
19
+ }),
8
20
  })
9
21
  .strict()
10
22
 
@@ -30,7 +30,7 @@ interface SnapshotLike {
30
30
  // ponytail: inline keyframes — Tailwind's utility classes cover layout but
31
31
  // not a custom pulse. Defined once, referenced via `animation`.
32
32
  const BLINK_CSS =
33
- "@keyframes sirenoCaBlink{0%,100%{background-color:transparent;color:var(--sireno-color-foreground)}50%{background-color:var(--sireno-color-accent);color:var(--sireno-color-background)}}"
33
+ "@keyframes sirenoCaBlink{0%,100%{background-color:transparent;color:var(--sireno-color-fg)}50%{background-color:var(--sireno-color-accent);color:var(--sireno-color-foreground-contrast)}}"
34
34
 
35
35
  // ponytail: matrix rain is pure CSS — strips translate down the column on
36
36
  // the compositor (no JS loop), and the character/geometry values are fixed at
@@ -72,7 +72,7 @@ const RAIN_COLUMNS = buildRainColumns(8)
72
72
 
73
73
  const RAIN_CSS = [
74
74
  "@keyframes sirenoCaFall{from{transform:translateY(-100%)}to{transform:translateY(100%)}}",
75
- ".sirenoCaRain{position:absolute;inset:0;overflow:hidden;pointer-events:none;opacity:0.55;color:color-mix(in oklab,var(--sireno-frame-border,var(--sireno-color-accent)) 30%,transparent)}",
75
+ ".sirenoCaRain{position:absolute;inset:0;overflow:hidden;pointer-events:none;opacity:0.55;color:color-mix(in oklab,var(--sireno-frame-border,var(--sireno-color-frame)) 30%,transparent)}",
76
76
  ".sirenoCaRainSt{position:absolute;top:0;width:1.5ch;display:flex;flex-direction:column;align-items:center;line-height:1;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;will-change:transform;animation:sirenoCaFall linear infinite}",
77
77
  "@media (prefers-reduced-motion:reduce){.sirenoCaRainSt{animation:none}}",
78
78
  ].join("")
@@ -213,7 +213,7 @@ const SummaryFrontend = (props: AddonFrontendButtonProps<SummaryConfig>) => {
213
213
  return (
214
214
  <div
215
215
  key={blinkKey}
216
- className="relative flex h-full w-full flex-col items-center justify-center gap-1 p-1 text-[color:var(--sireno-color-foreground)]"
216
+ className="relative flex h-full w-full flex-col items-center justify-center gap-1 p-1 text-[color:var(--sireno-color-fg)]"
217
217
  style={{
218
218
  animation: blinkKey > 0 ? "sirenoCaBlink 0.35s ease 3" : undefined,
219
219
  }}
@@ -256,12 +256,66 @@ const publishSnapshot = (): AgentsSnapshot => {
256
256
  return payload
257
257
  }
258
258
 
259
+ let captureFakeStage: string | null = null
260
+
261
+ const captureAgentsForStage = (stage: string): AgentsSnapshot => {
262
+ const statuses: Agent["status"][] =
263
+ stage === "updated"
264
+ ? [
265
+ ...Array.from({ length: 8 }, () => "running" as const),
266
+ "waiting_for_human",
267
+ "waiting_for_human",
268
+ "compacting",
269
+ ]
270
+ : [
271
+ "idle",
272
+ ...Array.from({ length: 10 }, () => "running" as const),
273
+ "waiting_for_human",
274
+ ]
275
+ const now = Date.now()
276
+ const agents: Agent[] = statuses.map((status, index) => ({
277
+ sessionId: `sireno-capture-${stage}-${index + 1}`,
278
+ providerId: index % 2 === 0 ? "opencode" : "claude-code",
279
+ title: `Showcase task ${index + 1}`,
280
+ status,
281
+ directory: "/works/sireno-deck",
282
+ updatedAt: now - index * 1_000,
283
+ createdAt: now - (index + 1) * 60_000,
284
+ }))
285
+ return mergeSnapshot(EMPTY_SNAPSHOT, {
286
+ opencode: agents.filter((agent) => agent.providerId === "opencode"),
287
+ "claude-code": agents.filter((agent) => agent.providerId === "claude-code"),
288
+ })
289
+ }
290
+
291
+ const syncCaptureFakeAgents = (): void => {
292
+ const stagePath = process.env["SIRENO_CAPTURE_FAKE_AGENTS_FILE"]
293
+ let stage = "initial"
294
+ if (stagePath !== undefined) {
295
+ try {
296
+ const payload = JSON.parse(readFileSync(stagePath, "utf8")) as {
297
+ stage?: unknown
298
+ }
299
+ if (payload.stage === "updated") stage = "updated"
300
+ } catch {
301
+ // Keep the initial values until the capture timeline writes a stage.
302
+ }
303
+ }
304
+ if (stage === captureFakeStage) return
305
+ state.lastSnapshot = captureAgentsForStage(stage)
306
+ captureFakeStage = stage
307
+ }
308
+
259
309
  const poller: AddonGlobalPoller = {
260
310
  id: "agents",
261
311
  channel: CHANNEL,
262
312
  intervalMs: POLLER_INTERVAL_MS,
263
313
  poll: async (ctx: AddonServiceContext) => {
264
314
  state.context = ctx
315
+ if (process.env["SIRENO_CAPTURE_FAKE_AGENTS"] === "1") {
316
+ syncCaptureFakeAgents()
317
+ return publishSnapshot()
318
+ }
265
319
  await setStateFromProviders()
266
320
  fireNotices(state.lastSnapshot)
267
321
  return publishSnapshot()
@@ -323,40 +377,7 @@ export const globalService: AddonGlobalService = {
323
377
  // provider polling and injects a deterministic agent list so web captures
324
378
  // show realistic "Agents" tiles without a live opencode / claude-code.
325
379
  if (process.env["SIRENO_CAPTURE_FAKE_AGENTS"] === "1") {
326
- const now = Date.now()
327
- const fake: Agent[] = [
328
- {
329
- sessionId: "sireno-capture-opencode-1",
330
- providerId: "opencode" as ProviderId,
331
- title: "Refactor capture pipeline",
332
- status: "running" as const,
333
- directory: "/works/sirenodeck",
334
- updatedAt: now,
335
- createdAt: now - 1000 * 60 * 12,
336
- },
337
- {
338
- sessionId: "sireno-capture-opencode-2",
339
- providerId: "opencode" as ProviderId,
340
- title: "Fix flaky session tests",
341
- status: "idle" as const,
342
- directory: "/works/sirenodeck/packages/cli",
343
- updatedAt: now - 1000 * 60 * 4,
344
- createdAt: now - 1000 * 60 * 40,
345
- },
346
- {
347
- sessionId: "sireno-capture-claude-1",
348
- providerId: "claude-code" as ProviderId,
349
- title: "Migrate themes",
350
- status: "waiting_for_human" as const,
351
- directory: "/works/sirenodeck/packages/web",
352
- updatedAt: now - 1000 * 60 * 2,
353
- createdAt: now - 1000 * 60 * 90,
354
- },
355
- ]
356
- state.lastSnapshot = mergeSnapshot(state.lastSnapshot, {
357
- opencode: fake.filter((a) => a.providerId === "opencode"),
358
- "claude-code": fake.filter((a) => a.providerId === "claude-code"),
359
- })
380
+ syncCaptureFakeAgents()
360
381
  publishSnapshot()
361
382
  return
362
383
  }
@@ -391,6 +412,7 @@ export const globalService: AddonGlobalService = {
391
412
  }
392
413
  state.providers.clear()
393
414
  state.lastSnapshot = EMPTY_SNAPSHOT
415
+ captureFakeStage = null
394
416
  state.lastSeenStatus.clear()
395
417
  state.throttle.reset()
396
418
  state.icons = {}
@@ -412,12 +412,11 @@ export class OpenCodeProvider implements AgentProvider {
412
412
  signal,
413
413
  )),
414
414
  ]
415
- } catch (err) {
415
+ } catch {
416
416
  if (signal.aborted) return []
417
- console.warn(
418
- "[coding-agents] opencode snapshot failed:",
419
- err instanceof Error ? err.message : String(err),
420
- )
417
+ // The API is optional: OpenCode's local instance leases still provide
418
+ // the active-agent state when its HTTP service is stopped or upgraded.
419
+ // Do not emit a warning on every poll for this expected fallback.
421
420
  return instances.map(toInstanceAgent)
422
421
  }
423
422
  }
@@ -4,8 +4,11 @@ import { IconSourceSchema } from "@/config/schemas"
4
4
 
5
5
  export const configSchema = z
6
6
  .object({
7
- icon: IconSourceSchema.optional(),
8
- label: z.string().optional(),
7
+ icon: IconSourceSchema.optional().meta({
8
+ title: "Icon",
9
+ "x-control": "icon",
10
+ }),
11
+ label: z.string().optional().meta({ title: "Label" }),
9
12
  })
10
13
  .refine((c) => Boolean(c.icon) || Boolean(c.label), {
11
14
  message: "core:action requires at least one of 'icon' or 'label'",
@@ -4,10 +4,13 @@ import { IconSourceSchema } from "@/config/schemas"
4
4
 
5
5
  export const configSchema = z
6
6
  .object({
7
- deck: z.string().min(1),
7
+ deck: z.string().min(1).meta({ title: "Target deck" }),
8
8
  addToHistory: z.boolean().default(true).meta({ internal: true }),
9
- icon: IconSourceSchema.optional(),
10
- label: z.string().optional(),
9
+ icon: IconSourceSchema.optional().meta({
10
+ title: "Icon",
11
+ "x-control": "icon",
12
+ }),
13
+ label: z.string().optional().meta({ title: "Label" }),
11
14
  })
12
15
  .refine((c) => Boolean(c.icon) || Boolean(c.label), {
13
16
  message: "core:change-deck requires at least one of 'icon' or 'label'",
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod"
2
2
 
3
3
  export const configSchema = z.object({
4
- channel: z.string().min(1),
5
- fallback: z.unknown().optional(),
4
+ channel: z.string().min(1).meta({ title: "Data channel" }),
5
+ fallback: z.unknown().optional().meta({ title: "Fallback value" }),
6
6
  })
7
7
  export type ConfigSchema = z.infer<typeof configSchema>
@@ -5,9 +5,15 @@ export const TOGGLE_DEFAULT_TIMEOUT_MS = 5000
5
5
 
6
6
  export const StatusToggleStateSchema = z
7
7
  .object({
8
- label: z.string().min(1).optional(),
9
- icon: z.string().min(1).optional(),
10
- onTap: z.string().min(1).optional(),
8
+ label: z.string().min(1).optional().meta({ title: "Label" }),
9
+ icon: z.string().min(1).optional().meta({
10
+ title: "Icon",
11
+ "x-control": "icon",
12
+ }),
13
+ onTap: z.string().min(1).optional().meta({
14
+ title: "Tap action",
15
+ "x-control": "shell",
16
+ }),
11
17
  })
12
18
  .strict()
13
19
  .refine((s) => s.label !== undefined || s.icon !== undefined, {
@@ -18,24 +24,35 @@ export type StatusToggleState = z.infer<typeof StatusToggleStateSchema>
18
24
 
19
25
  export const StatusToggleConfigSchema = z
20
26
  .object({
21
- statusCommand: z.string().min(1),
22
- intervalMs: z.number().int().positive().optional(),
23
- timeoutMs: z.number().int().positive().optional(),
24
- states: z.record(z.string().min(1), StatusToggleStateSchema),
27
+ statusCommand: z.string().min(1).meta({
28
+ title: "Command to read current state",
29
+ "x-control": "shell",
30
+ }),
31
+ intervalMs: z.number().int().positive().optional().meta({
32
+ title: "Refresh interval (ms)",
33
+ }),
34
+ timeoutMs: z.number().int().positive().optional().meta({
35
+ title: "Command timeout (ms)",
36
+ }),
37
+ states: z.record(z.string().min(1), StatusToggleStateSchema).meta({
38
+ title: "Toggle states",
39
+ }),
25
40
  })
26
41
  .strict()
27
42
  .refine((c) => Object.keys(c.states).length > 0, {
28
43
  message: "`states` must declare at least one entry",
29
44
  })
45
+ .meta({ title: "Status-driven toggle" })
30
46
 
31
47
  export type StatusToggleConfig = z.infer<typeof StatusToggleConfigSchema>
32
48
 
33
49
  export const LegacyToggleConfigSchema = z
34
50
  .object({
35
- key: z.string().min(1),
36
- default: z.boolean().default(false),
51
+ key: z.string().min(1).meta({ title: "State key" }),
52
+ default: z.boolean().default(false).meta({ title: "Initial state" }),
37
53
  })
38
54
  .strict()
55
+ .meta({ title: "Boolean toggle" })
39
56
 
40
57
  export type LegacyToggleConfig = z.infer<typeof LegacyToggleConfigSchema>
41
58
 
@@ -2,7 +2,11 @@ import { z } from "zod"
2
2
 
3
3
  export const configSchema = z
4
4
  .object({
5
- format: z.string().min(1).optional().default("DD/MM/YYYY HH:mm:ss"),
5
+ format: z.string().min(1).optional().default("DD/MM/YYYY HH:mm:ss").meta({
6
+ title: "Date and time format",
7
+ description:
8
+ "Tokens: YYYY/YY, MMMM/MMM/MM/M, dddd/ddd/d, DD/D, HH/H, hh/h, mm/m, ss/s, SSS, A/a. Rich tags: <strong>, <highlight>, <blink>, <dim>, <accent>, <danger>, <foreground>, <primary>, <success>, and <xxs> through <5xl>. Use &nbsp; for a non-breaking space.",
9
+ }),
6
10
  })
7
11
  .strict()
8
12
 
@@ -2,8 +2,8 @@ import { z } from "zod"
2
2
 
3
3
  export const configSchema = z
4
4
  .object({
5
- locale: z.string().min(2).max(35).optional(),
6
- time_zone: z.string().min(1).optional(),
5
+ locale: z.string().min(2).max(35).optional().meta({ title: "Locale" }),
6
+ time_zone: z.string().min(1).optional().meta({ title: "Time zone" }),
7
7
  })
8
8
  .strict()
9
9
 
@@ -2,7 +2,11 @@ import { z } from "zod"
2
2
 
3
3
  export const configSchema = z
4
4
  .object({
5
- variant: z.enum(["default", "big"]).optional().default("default"),
5
+ variant: z
6
+ .enum(["default", "big"])
7
+ .optional()
8
+ .default("default")
9
+ .meta({ title: "Time style" }),
6
10
  })
7
11
  .strict()
8
12
 
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod"
2
2
 
3
3
  export const configSchema = z.object({
4
- target_deck: z.string().min(1),
5
- icon: z.string().min(1),
6
- label: z.string().min(1),
4
+ target_deck: z.string().min(1).meta({ title: "Target deck" }),
5
+ icon: z.string().min(1).meta({ title: "Icon", "x-control": "icon" }),
6
+ label: z.string().min(1).meta({ title: "Label" }),
7
7
  })
8
8
  export type ConfigSchema = z.infer<typeof configSchema>
@@ -3,7 +3,10 @@ import { z } from "zod"
3
3
  import { EMOJI_RE } from "@/core/icon-source"
4
4
 
5
5
  export const configSchema = z.object({
6
- emoji: z.string().regex(EMOJI_RE),
7
- shortcode: z.string().optional(),
6
+ emoji: z
7
+ .string()
8
+ .regex(EMOJI_RE)
9
+ .meta({ title: "Emoji", "x-control": "emoji" }),
10
+ shortcode: z.string().optional().meta({ title: "Shortcode" }),
8
11
  })
9
12
  export type ConfigSchema = z.infer<typeof configSchema>
@@ -27,12 +27,15 @@ export const DEFAULT_FAVORITES: readonly string[] = [
27
27
 
28
28
  export const EmojiLauncherButtonSchema = z
29
29
  .object({
30
- label: z.string().min(1).default("Emojis"),
30
+ label: z.string().min(1).default("Emojis").meta({ title: "Button label" }),
31
31
  // Curated favorites shown first in the emoji deck. Valid on the launcher
32
32
  // button (this schema) AND on the per-deck override record
33
33
  // (decks["emoji-selector:__multi__"].config.favorites); the launcher
34
34
  // wins when both are set. Falls back to DEFAULT_FAVORITES.
35
- favorites: z.array(z.string().min(1)).optional(),
35
+ favorites: z
36
+ .array(z.string().min(1).meta({ "x-control": "emoji" }))
37
+ .optional()
38
+ .meta({ title: "Favorite emoji" }),
36
39
  })
37
40
  .strict()
38
41
 
@@ -0,0 +1,23 @@
1
+ import { globalService as codingAgentsGlobalService } from "./coding-agents/global-entry"
2
+
3
+ /**
4
+ * Builtin global services, by addon name, as objects rather than file paths.
5
+ *
6
+ * ponytail: a builtin's global service is the thing that actually produces its
7
+ * data, and the bridge used to reach it with `await import(<globalServiceEntry>)`.
8
+ * That path names TypeScript source, so plain node — which is what runs the
9
+ * published bundle — cannot load it, and the addon ends up with buttons that
10
+ * render and never update. `coding-agents` is the one builtin that keeps its
11
+ * service in a separate `global-entry.ts`, deliberately: `index.ts` is pulled
12
+ * into the browser bundle by the frontend's virtual addon registry, and a node
13
+ * builtin reachable from there takes the whole frontend down.
14
+ *
15
+ * This module is therefore NODE-ONLY and must stay that way. It is imported by
16
+ * the addon bridge and nothing on the browser side; importing it from a module
17
+ * the frontend can reach would put `fs` in the browser graph and undo the very
18
+ * separation `global-entry.ts` exists to maintain.
19
+ */
20
+ export const BUILTIN_GLOBAL_SERVICES: ReadonlyMap<string, unknown> = new Map<
21
+ string,
22
+ unknown
23
+ >([["coding-agents", codingAgentsGlobalService]])
@@ -6,7 +6,8 @@ export const configSchema = z
6
6
  .string()
7
7
  .min(1)
8
8
  .optional()
9
- .default("addon://internal-settings/logo72x72.png"),
9
+ .default("addon://internal-settings/logo72x72.png")
10
+ .meta({ title: "Icon", "x-control": "icon" }),
10
11
  })
11
12
  .strict()
12
13
 
@@ -1,6 +1,11 @@
1
1
  import { z } from "zod"
2
2
 
3
3
  export const configSchema = z.object({
4
- step: z.number().positive().max(100).default(5),
4
+ step: z
5
+ .number()
6
+ .positive()
7
+ .max(100)
8
+ .default(5)
9
+ .meta({ title: "Brightness step" }),
5
10
  })
6
11
  export type ConfigSchema = z.infer<typeof configSchema>
@@ -1,6 +1,11 @@
1
1
  import { z } from "zod"
2
2
 
3
3
  export const configSchema = z.object({
4
- step: z.number().positive().max(100).default(5),
4
+ step: z
5
+ .number()
6
+ .positive()
7
+ .max(100)
8
+ .default(5)
9
+ .meta({ title: "Brightness step" }),
5
10
  })
6
11
  export type ConfigSchema = z.infer<typeof configSchema>