@pellux/goodvibes-sdk 0.25.10 → 0.25.12

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 (220) hide show
  1. package/dist/_internal/contracts/artifacts/operator-contract.json +178 -6
  2. package/dist/_internal/contracts/generated/foundation-client-types.d.ts +16 -1
  3. package/dist/_internal/contracts/generated/foundation-client-types.d.ts.map +1 -1
  4. package/dist/_internal/contracts/generated/foundation-metadata.d.ts +2 -2
  5. package/dist/_internal/contracts/generated/foundation-metadata.js +2 -2
  6. package/dist/_internal/contracts/generated/operator-contract.d.ts.map +1 -1
  7. package/dist/_internal/contracts/generated/operator-contract.js +178 -6
  8. package/dist/_internal/contracts/generated/operator-method-ids.d.ts +1 -1
  9. package/dist/_internal/contracts/generated/operator-method-ids.d.ts.map +1 -1
  10. package/dist/_internal/contracts/generated/operator-method-ids.js +1 -0
  11. package/dist/_internal/daemon/context.d.ts +1 -0
  12. package/dist/_internal/daemon/context.d.ts.map +1 -1
  13. package/dist/_internal/daemon/integration-route-types.d.ts +1 -0
  14. package/dist/_internal/daemon/integration-route-types.d.ts.map +1 -1
  15. package/dist/_internal/daemon/integration-routes.d.ts +1 -1
  16. package/dist/_internal/daemon/integration-routes.d.ts.map +1 -1
  17. package/dist/_internal/daemon/integration-routes.js +3 -0
  18. package/dist/_internal/daemon/operator.d.ts +1 -1
  19. package/dist/_internal/daemon/operator.d.ts.map +1 -1
  20. package/dist/_internal/daemon/operator.js +2 -0
  21. package/dist/_internal/daemon/runtime-route-types.d.ts +1 -1
  22. package/dist/_internal/daemon/runtime-route-types.d.ts.map +1 -1
  23. package/dist/_internal/platform/adapters/discord/index.d.ts.map +1 -1
  24. package/dist/_internal/platform/adapters/discord/index.js +4 -5
  25. package/dist/_internal/platform/adapters/github/index.d.ts.map +1 -1
  26. package/dist/_internal/platform/adapters/github/index.js +4 -5
  27. package/dist/_internal/platform/adapters/google-chat/index.d.ts.map +1 -1
  28. package/dist/_internal/platform/adapters/google-chat/index.js +7 -5
  29. package/dist/_internal/platform/adapters/helpers.d.ts +2 -1
  30. package/dist/_internal/platform/adapters/helpers.d.ts.map +1 -1
  31. package/dist/_internal/platform/adapters/helpers.js +3 -34
  32. package/dist/_internal/platform/adapters/homeassistant/index.d.ts +3 -0
  33. package/dist/_internal/platform/adapters/homeassistant/index.d.ts.map +1 -0
  34. package/dist/_internal/platform/adapters/homeassistant/index.js +185 -0
  35. package/dist/_internal/platform/adapters/index.d.ts +1 -0
  36. package/dist/_internal/platform/adapters/index.d.ts.map +1 -1
  37. package/dist/_internal/platform/adapters/index.js +1 -0
  38. package/dist/_internal/platform/adapters/mattermost/index.d.ts.map +1 -1
  39. package/dist/_internal/platform/adapters/mattermost/index.js +6 -2
  40. package/dist/_internal/platform/adapters/slack/index.d.ts.map +1 -1
  41. package/dist/_internal/platform/adapters/slack/index.js +4 -5
  42. package/dist/_internal/platform/adapters/telegram/index.d.ts.map +1 -1
  43. package/dist/_internal/platform/adapters/telegram/index.js +7 -5
  44. package/dist/_internal/platform/adapters/types.d.ts +1 -1
  45. package/dist/_internal/platform/adapters/types.d.ts.map +1 -1
  46. package/dist/_internal/platform/adapters/webhook/index.d.ts.map +1 -1
  47. package/dist/_internal/platform/adapters/webhook/index.js +4 -1
  48. package/dist/_internal/platform/automation/types.d.ts +1 -1
  49. package/dist/_internal/platform/automation/types.d.ts.map +1 -1
  50. package/dist/_internal/platform/channels/builtin/accounts.d.ts.map +1 -1
  51. package/dist/_internal/platform/channels/builtin/accounts.js +23 -0
  52. package/dist/_internal/platform/channels/builtin/contracts.d.ts.map +1 -1
  53. package/dist/_internal/platform/channels/builtin/contracts.js +9 -0
  54. package/dist/_internal/platform/channels/builtin/descriptors.d.ts.map +1 -1
  55. package/dist/_internal/platform/channels/builtin/descriptors.js +9 -2
  56. package/dist/_internal/platform/channels/builtin/homeassistant.d.ts +64 -0
  57. package/dist/_internal/platform/channels/builtin/homeassistant.d.ts.map +1 -0
  58. package/dist/_internal/platform/channels/builtin/homeassistant.js +391 -0
  59. package/dist/_internal/platform/channels/builtin/plugins.d.ts.map +1 -1
  60. package/dist/_internal/platform/channels/builtin/plugins.js +2 -1
  61. package/dist/_internal/platform/channels/builtin/presentation.d.ts.map +1 -1
  62. package/dist/_internal/platform/channels/builtin/presentation.js +4 -0
  63. package/dist/_internal/platform/channels/builtin/rendering.d.ts.map +1 -1
  64. package/dist/_internal/platform/channels/builtin/rendering.js +7 -0
  65. package/dist/_internal/platform/channels/builtin/setup-schema.d.ts.map +1 -1
  66. package/dist/_internal/platform/channels/builtin/setup-schema.js +53 -0
  67. package/dist/_internal/platform/channels/builtin/shared.d.ts +1 -1
  68. package/dist/_internal/platform/channels/builtin/shared.d.ts.map +1 -1
  69. package/dist/_internal/platform/channels/builtin/shared.js +2 -0
  70. package/dist/_internal/platform/channels/builtin/surfaces.d.ts.map +1 -1
  71. package/dist/_internal/platform/channels/builtin/surfaces.js +1 -0
  72. package/dist/_internal/platform/channels/builtin/targets.d.ts.map +1 -1
  73. package/dist/_internal/platform/channels/builtin/targets.js +24 -0
  74. package/dist/_internal/platform/channels/builtin-runtime.d.ts.map +1 -1
  75. package/dist/_internal/platform/channels/builtin-runtime.js +6 -0
  76. package/dist/_internal/platform/channels/delivery/strategies-core.d.ts +1 -0
  77. package/dist/_internal/platform/channels/delivery/strategies-core.d.ts.map +1 -1
  78. package/dist/_internal/platform/channels/delivery/strategies-core.js +60 -1
  79. package/dist/_internal/platform/channels/delivery/types.d.ts +2 -0
  80. package/dist/_internal/platform/channels/delivery/types.d.ts.map +1 -1
  81. package/dist/_internal/platform/channels/delivery-router.d.ts.map +1 -1
  82. package/dist/_internal/platform/channels/delivery-router.js +2 -1
  83. package/dist/_internal/platform/channels/reply-pipeline.d.ts.map +1 -1
  84. package/dist/_internal/platform/channels/reply-pipeline.js +9 -0
  85. package/dist/_internal/platform/channels/route-manager.d.ts.map +1 -1
  86. package/dist/_internal/platform/channels/route-manager.js +1 -0
  87. package/dist/_internal/platform/channels/surface-registry.d.ts.map +1 -1
  88. package/dist/_internal/platform/channels/surface-registry.js +4 -0
  89. package/dist/_internal/platform/channels/types.d.ts +1 -1
  90. package/dist/_internal/platform/channels/types.d.ts.map +1 -1
  91. package/dist/_internal/platform/cloudflare/manager.d.ts +1 -1
  92. package/dist/_internal/platform/cloudflare/manager.d.ts.map +1 -1
  93. package/dist/_internal/platform/cloudflare/manager.js +27 -24
  94. package/dist/_internal/platform/cloudflare/types.d.ts +5 -0
  95. package/dist/_internal/platform/cloudflare/types.d.ts.map +1 -1
  96. package/dist/_internal/platform/cloudflare/utils.d.ts.map +1 -1
  97. package/dist/_internal/platform/cloudflare/utils.js +4 -10
  98. package/dist/_internal/platform/companion/companion-chat-manager.d.ts +24 -4
  99. package/dist/_internal/platform/companion/companion-chat-manager.d.ts.map +1 -1
  100. package/dist/_internal/platform/companion/companion-chat-manager.js +128 -78
  101. package/dist/_internal/platform/config/schema-domain-surfaces.d.ts +12 -0
  102. package/dist/_internal/platform/config/schema-domain-surfaces.d.ts.map +1 -1
  103. package/dist/_internal/platform/config/schema-domain-surfaces.js +67 -0
  104. package/dist/_internal/platform/config/schema-types.d.ts +15 -2
  105. package/dist/_internal/platform/config/schema-types.d.ts.map +1 -1
  106. package/dist/_internal/platform/control-plane/gateway-utils.d.ts +37 -0
  107. package/dist/_internal/platform/control-plane/gateway-utils.d.ts.map +1 -0
  108. package/dist/_internal/platform/control-plane/gateway-utils.js +97 -0
  109. package/dist/_internal/platform/control-plane/gateway.d.ts +4 -9
  110. package/dist/_internal/platform/control-plane/gateway.d.ts.map +1 -1
  111. package/dist/_internal/platform/control-plane/gateway.js +26 -61
  112. package/dist/_internal/platform/control-plane/method-catalog-runtime.d.ts.map +1 -1
  113. package/dist/_internal/platform/control-plane/method-catalog-runtime.js +11 -1
  114. package/dist/_internal/platform/control-plane/operator-contract-schemas-admin.d.ts.map +1 -1
  115. package/dist/_internal/platform/control-plane/operator-contract-schemas-admin.js +3 -2
  116. package/dist/_internal/platform/control-plane/operator-contract-schemas-control.d.ts +1 -0
  117. package/dist/_internal/platform/control-plane/operator-contract-schemas-control.d.ts.map +1 -1
  118. package/dist/_internal/platform/control-plane/operator-contract-schemas-control.js +26 -0
  119. package/dist/_internal/platform/control-plane/routes/operator.d.ts +1 -1
  120. package/dist/_internal/platform/control-plane/routes/operator.d.ts.map +1 -1
  121. package/dist/_internal/platform/control-plane/routes/operator.js +2 -0
  122. package/dist/_internal/platform/control-plane/session-types.d.ts +2 -1
  123. package/dist/_internal/platform/control-plane/session-types.d.ts.map +1 -1
  124. package/dist/_internal/platform/control-plane/types.d.ts +1 -1
  125. package/dist/_internal/platform/control-plane/types.d.ts.map +1 -1
  126. package/dist/_internal/platform/daemon/control-plane.d.ts.map +1 -1
  127. package/dist/_internal/platform/daemon/control-plane.js +50 -6
  128. package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
  129. package/dist/_internal/platform/daemon/facade-composition.js +30 -2
  130. package/dist/_internal/platform/daemon/facade-types.d.ts +1 -1
  131. package/dist/_internal/platform/daemon/facade-types.d.ts.map +1 -1
  132. package/dist/_internal/platform/daemon/http/homeassistant-routes.d.ts +40 -0
  133. package/dist/_internal/platform/daemon/http/homeassistant-routes.d.ts.map +1 -0
  134. package/dist/_internal/platform/daemon/http/homeassistant-routes.js +468 -0
  135. package/dist/_internal/platform/daemon/http/router.d.ts +4 -2
  136. package/dist/_internal/platform/daemon/http/router.d.ts.map +1 -1
  137. package/dist/_internal/platform/daemon/http/router.js +28 -16
  138. package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts +1 -1
  139. package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  140. package/dist/_internal/platform/daemon/http-listener.d.ts.map +1 -1
  141. package/dist/_internal/platform/daemon/http-listener.js +4 -8
  142. package/dist/_internal/platform/daemon/surface-actions.d.ts +1 -1
  143. package/dist/_internal/platform/daemon/surface-actions.d.ts.map +1 -1
  144. package/dist/_internal/platform/daemon/surface-delivery.d.ts +1 -1
  145. package/dist/_internal/platform/daemon/surface-delivery.d.ts.map +1 -1
  146. package/dist/_internal/platform/daemon/surface-delivery.js +15 -0
  147. package/dist/_internal/platform/daemon/surface-policy.d.ts +1 -1
  148. package/dist/_internal/platform/daemon/surface-policy.d.ts.map +1 -1
  149. package/dist/_internal/platform/daemon/surface-policy.js +8 -0
  150. package/dist/_internal/platform/daemon/types.d.ts +3 -3
  151. package/dist/_internal/platform/daemon/types.d.ts.map +1 -1
  152. package/dist/_internal/platform/integrations/homeassistant.d.ts +62 -0
  153. package/dist/_internal/platform/integrations/homeassistant.d.ts.map +1 -0
  154. package/dist/_internal/platform/integrations/homeassistant.js +174 -0
  155. package/dist/_internal/platform/integrations/index.d.ts +2 -0
  156. package/dist/_internal/platform/integrations/index.d.ts.map +1 -1
  157. package/dist/_internal/platform/integrations/index.js +1 -0
  158. package/dist/_internal/platform/runtime/events/control-plane.d.ts +1 -1
  159. package/dist/_internal/platform/runtime/events/control-plane.d.ts.map +1 -1
  160. package/dist/_internal/platform/runtime/events/control-plane.js +1 -0
  161. package/dist/_internal/platform/runtime/events/routes.d.ts +1 -1
  162. package/dist/_internal/platform/runtime/events/routes.d.ts.map +1 -1
  163. package/dist/_internal/platform/runtime/events/routes.js +1 -0
  164. package/dist/_internal/platform/runtime/feature-flags/flags.d.ts.map +1 -1
  165. package/dist/_internal/platform/runtime/feature-flags/flags.js +9 -0
  166. package/dist/_internal/platform/runtime/feature-flags/gates.d.ts.map +1 -1
  167. package/dist/_internal/platform/runtime/feature-flags/gates.js +2 -0
  168. package/dist/_internal/platform/runtime/index.d.ts +2 -0
  169. package/dist/_internal/platform/runtime/index.d.ts.map +1 -1
  170. package/dist/_internal/platform/runtime/index.js +1 -0
  171. package/dist/_internal/platform/runtime/integration/helpers.d.ts +4 -0
  172. package/dist/_internal/platform/runtime/integration/helpers.d.ts.map +1 -1
  173. package/dist/_internal/platform/runtime/integration/helpers.js +4 -0
  174. package/dist/_internal/platform/runtime/security-settings.d.ts +19 -0
  175. package/dist/_internal/platform/runtime/security-settings.d.ts.map +1 -0
  176. package/dist/_internal/platform/runtime/security-settings.js +187 -0
  177. package/dist/_internal/platform/runtime/services.d.ts.map +1 -1
  178. package/dist/_internal/platform/runtime/services.js +1 -0
  179. package/dist/_internal/platform/security/user-auth.d.ts +1 -1
  180. package/dist/_internal/platform/security/user-auth.d.ts.map +1 -1
  181. package/dist/_internal/platform/security/user-auth.js +18 -3
  182. package/dist/_internal/platform/tools/edit/core.d.ts.map +1 -1
  183. package/dist/_internal/platform/tools/edit/core.js +4 -47
  184. package/dist/_internal/platform/tools/exec/runtime.d.ts.map +1 -1
  185. package/dist/_internal/platform/tools/exec/runtime.js +7 -1
  186. package/dist/_internal/platform/tools/exec/schema.d.ts +1 -0
  187. package/dist/_internal/platform/tools/exec/schema.d.ts.map +1 -1
  188. package/dist/_internal/platform/tools/exec/schema.js +1 -0
  189. package/dist/_internal/platform/tools/fetch/runtime.d.ts.map +1 -1
  190. package/dist/_internal/platform/tools/fetch/runtime.js +140 -19
  191. package/dist/_internal/platform/tools/fetch/schema.d.ts +1 -0
  192. package/dist/_internal/platform/tools/fetch/schema.d.ts.map +1 -1
  193. package/dist/_internal/platform/tools/fetch/schema.js +1 -0
  194. package/dist/_internal/platform/tools/find/executor.d.ts.map +1 -1
  195. package/dist/_internal/platform/tools/find/executor.js +7 -1
  196. package/dist/_internal/platform/tools/find/schema.d.ts.map +1 -1
  197. package/dist/_internal/platform/tools/find/schema.js +2 -0
  198. package/dist/_internal/platform/tools/read/index.d.ts.map +1 -1
  199. package/dist/_internal/platform/tools/read/index.js +7 -1
  200. package/dist/_internal/platform/tools/read/schema.d.ts +1 -0
  201. package/dist/_internal/platform/tools/read/schema.d.ts.map +1 -1
  202. package/dist/_internal/platform/tools/read/schema.js +1 -0
  203. package/dist/_internal/platform/tools/shared/process-manager.d.ts +2 -0
  204. package/dist/_internal/platform/tools/shared/process-manager.d.ts.map +1 -1
  205. package/dist/_internal/platform/tools/shared/process-manager.js +67 -5
  206. package/dist/_internal/platform/tools/write/index.d.ts.map +1 -1
  207. package/dist/_internal/platform/tools/write/index.js +3 -36
  208. package/dist/_internal/platform/utils/concurrency.d.ts +3 -0
  209. package/dist/_internal/platform/utils/concurrency.d.ts.map +1 -0
  210. package/dist/_internal/platform/utils/concurrency.js +17 -0
  211. package/dist/_internal/platform/utils/logger.d.ts.map +1 -1
  212. package/dist/_internal/platform/utils/logger.js +19 -1
  213. package/dist/_internal/platform/utils/request-body.d.ts +4 -0
  214. package/dist/_internal/platform/utils/request-body.d.ts.map +1 -0
  215. package/dist/_internal/platform/utils/request-body.js +45 -0
  216. package/dist/_internal/platform/version.js +1 -1
  217. package/dist/workers.d.ts +6 -0
  218. package/dist/workers.d.ts.map +1 -1
  219. package/dist/workers.js +55 -3
  220. package/package.json +1 -1
@@ -0,0 +1,391 @@
1
+ import { resolveSecretInput } from '../../config/secret-refs.js';
2
+ import { HomeAssistantIntegration } from '../../integrations/homeassistant.js';
3
+ export const HOME_ASSISTANT_SURFACE = 'homeassistant';
4
+ export const HOME_ASSISTANT_WEBHOOK_PATH = '/webhook/homeassistant';
5
+ export const HOME_ASSISTANT_DEFAULT_EVENT_TYPE = 'goodvibes_message';
6
+ const HOME_ASSISTANT_TOKEN_ENV = [
7
+ 'HOMEASSISTANT_ACCESS_TOKEN',
8
+ 'HOME_ASSISTANT_ACCESS_TOKEN',
9
+ 'HA_ACCESS_TOKEN',
10
+ ];
11
+ const HOME_ASSISTANT_URL_ENV = [
12
+ 'HOMEASSISTANT_URL',
13
+ 'HOME_ASSISTANT_URL',
14
+ 'HA_URL',
15
+ ];
16
+ const HOME_ASSISTANT_WEBHOOK_SECRET_ENV = [
17
+ 'HOMEASSISTANT_WEBHOOK_SECRET',
18
+ 'HOME_ASSISTANT_WEBHOOK_SECRET',
19
+ 'HA_GOODVIBES_WEBHOOK_SECRET',
20
+ ];
21
+ export function listHomeAssistantOperatorActions() {
22
+ const surface = HOME_ASSISTANT_SURFACE;
23
+ return [
24
+ action(surface, 'homeassistant-manifest', 'Home Assistant manifest', 'Return the daemon/device contract consumed by the Home Assistant integration.'),
25
+ action(surface, 'homeassistant-status', 'Check Home Assistant', 'Check configured Home Assistant API reachability and token posture.'),
26
+ action(surface, 'homeassistant-list-states', 'List Home Assistant states', 'List current Home Assistant entity states with optional domain filtering.'),
27
+ action(surface, 'homeassistant-get-state', 'Get Home Assistant state', 'Read a single Home Assistant entity state.', {
28
+ type: 'object',
29
+ properties: { entityId: { type: 'string' } },
30
+ required: ['entityId'],
31
+ }),
32
+ action(surface, 'homeassistant-list-services', 'List Home Assistant services', 'List callable Home Assistant service actions.'),
33
+ action(surface, 'homeassistant-call-service', 'Call Home Assistant service', 'Call a Home Assistant service action such as light.turn_on.', {
34
+ type: 'object',
35
+ properties: {
36
+ domain: { type: 'string' },
37
+ service: { type: 'string' },
38
+ serviceData: { type: 'object', additionalProperties: true },
39
+ returnResponse: { type: 'boolean' },
40
+ },
41
+ required: ['domain', 'service'],
42
+ additionalProperties: true,
43
+ }, true),
44
+ action(surface, 'homeassistant-fire-event', 'Fire Home Assistant event', 'Fire an event on the Home Assistant event bus.', {
45
+ type: 'object',
46
+ properties: {
47
+ eventType: { type: 'string' },
48
+ eventData: { type: 'object', additionalProperties: true },
49
+ },
50
+ required: ['eventType'],
51
+ additionalProperties: true,
52
+ }, true),
53
+ action(surface, 'homeassistant-render-template', 'Render Home Assistant template', 'Render a Home Assistant template through the configured instance.', {
54
+ type: 'object',
55
+ properties: {
56
+ template: { type: 'string' },
57
+ variables: { type: 'object', additionalProperties: true },
58
+ },
59
+ required: ['template'],
60
+ additionalProperties: true,
61
+ }),
62
+ action(surface, 'homeassistant-publish-goodvibes-event', 'Publish GoodVibes event', 'Publish a GoodVibes message event into Home Assistant.', {
63
+ type: 'object',
64
+ properties: {
65
+ title: { type: 'string' },
66
+ body: { type: 'string' },
67
+ status: { type: 'string' },
68
+ metadata: { type: 'object', additionalProperties: true },
69
+ },
70
+ required: ['body'],
71
+ additionalProperties: true,
72
+ }),
73
+ ];
74
+ }
75
+ export function listHomeAssistantTools() {
76
+ const surface = HOME_ASSISTANT_SURFACE;
77
+ return [
78
+ tool(surface, 'homeassistant:manifest', 'homeassistant_manifest', 'Return the Home Assistant integration manifest and daemon endpoint contract.', ['homeassistant-manifest']),
79
+ tool(surface, 'homeassistant:status', 'homeassistant_status', 'Check Home Assistant API reachability and token posture.', ['homeassistant-status']),
80
+ tool(surface, 'homeassistant:states', 'homeassistant_states', 'List Home Assistant entity states.', ['homeassistant-list-states'], {
81
+ type: 'object',
82
+ properties: {
83
+ domain: { type: 'string' },
84
+ query: { type: 'string' },
85
+ limit: { type: 'number' },
86
+ },
87
+ additionalProperties: false,
88
+ }),
89
+ tool(surface, 'homeassistant:state', 'homeassistant_state', 'Read one Home Assistant entity state.', ['homeassistant-get-state'], {
90
+ type: 'object',
91
+ properties: { entityId: { type: 'string' } },
92
+ required: ['entityId'],
93
+ additionalProperties: false,
94
+ }),
95
+ tool(surface, 'homeassistant:services', 'homeassistant_services', 'List callable Home Assistant service actions.', ['homeassistant-list-services']),
96
+ tool(surface, 'homeassistant:call_service', 'homeassistant_call_service', 'Call a Home Assistant service action.', ['homeassistant-call-service'], {
97
+ type: 'object',
98
+ properties: {
99
+ domain: { type: 'string' },
100
+ service: { type: 'string' },
101
+ serviceData: { type: 'object', additionalProperties: true },
102
+ returnResponse: { type: 'boolean' },
103
+ },
104
+ required: ['domain', 'service'],
105
+ additionalProperties: true,
106
+ }),
107
+ tool(surface, 'homeassistant:fire_event', 'homeassistant_fire_event', 'Fire an event on the Home Assistant event bus.', ['homeassistant-fire-event'], {
108
+ type: 'object',
109
+ properties: {
110
+ eventType: { type: 'string' },
111
+ eventData: { type: 'object', additionalProperties: true },
112
+ },
113
+ required: ['eventType'],
114
+ additionalProperties: true,
115
+ }),
116
+ tool(surface, 'homeassistant:render_template', 'homeassistant_render_template', 'Render a Home Assistant template.', ['homeassistant-render-template'], {
117
+ type: 'object',
118
+ properties: {
119
+ template: { type: 'string' },
120
+ variables: { type: 'object', additionalProperties: true },
121
+ },
122
+ required: ['template'],
123
+ additionalProperties: true,
124
+ }),
125
+ ];
126
+ }
127
+ export async function runHomeAssistantOperatorAction(context, actionId, input) {
128
+ switch (actionId) {
129
+ case 'homeassistant-manifest':
130
+ return { handled: true, result: buildHomeAssistantManifest(context.deps) };
131
+ case 'homeassistant-status':
132
+ return { handled: true, result: await checkHomeAssistantStatus(context.deps) };
133
+ case 'homeassistant-list-states':
134
+ return { handled: true, result: await listHomeAssistantStates(context.deps, input) };
135
+ case 'homeassistant-get-state':
136
+ return { handled: true, result: await getHomeAssistantState(context.deps, input) };
137
+ case 'homeassistant-list-services':
138
+ return { handled: true, result: await listHomeAssistantServices(context.deps) };
139
+ case 'homeassistant-call-service':
140
+ return { handled: true, result: await callHomeAssistantService(context.deps, input) };
141
+ case 'homeassistant-fire-event':
142
+ return { handled: true, result: await fireHomeAssistantEvent(context.deps, input) };
143
+ case 'homeassistant-render-template':
144
+ return { handled: true, result: await renderHomeAssistantTemplate(context.deps, input) };
145
+ case 'homeassistant-publish-goodvibes-event':
146
+ return { handled: true, result: await publishGoodVibesEvent(context.deps, input) };
147
+ default:
148
+ return { handled: false, result: null };
149
+ }
150
+ }
151
+ export function buildHomeAssistantManifest(deps) {
152
+ const baseUrl = firstNonEmpty(String(deps.configManager.get('controlPlane.baseUrl') ?? ''), String(deps.configManager.get('web.publicBaseUrl') ?? '')) ?? '';
153
+ const eventType = String(deps.configManager.get('surfaces.homeassistant.eventType') ?? HOME_ASSISTANT_DEFAULT_EVENT_TYPE);
154
+ const deviceId = String(deps.configManager.get('surfaces.homeassistant.deviceId') ?? 'goodvibes-daemon') || 'goodvibes-daemon';
155
+ return {
156
+ protocolVersion: 1,
157
+ surface: HOME_ASSISTANT_SURFACE,
158
+ label: 'Home Assistant',
159
+ device: {
160
+ identifiers: [`goodvibes:${deviceId}`],
161
+ manufacturer: 'GoodVibes',
162
+ model: 'GoodVibes Daemon',
163
+ name: String(deps.configManager.get('surfaces.homeassistant.deviceName') ?? 'GoodVibes Daemon') || 'GoodVibes Daemon',
164
+ },
165
+ daemon: {
166
+ baseUrl,
167
+ auth: 'bearer',
168
+ endpoints: {
169
+ setup: '/api/channels/setup/homeassistant',
170
+ account: '/api/channels/accounts/homeassistant',
171
+ capabilities: '/api/channels/capabilities/homeassistant',
172
+ tools: '/api/channels/tools/homeassistant',
173
+ agentTools: '/api/channels/agent-tools/homeassistant',
174
+ actions: '/api/channels/actions/homeassistant',
175
+ directory: '/api/channels/directory/homeassistant',
176
+ resolveTarget: '/api/channels/targets/homeassistant/resolve',
177
+ webhook: HOME_ASSISTANT_WEBHOOK_PATH,
178
+ conversation: '/api/homeassistant/conversation',
179
+ conversationStream: '/api/homeassistant/conversation/stream',
180
+ conversationCancel: '/api/homeassistant/conversation/cancel',
181
+ health: '/api/homeassistant/health',
182
+ eventStream: '/api/control-plane/events',
183
+ },
184
+ },
185
+ capabilities: [
186
+ 'conversation-ingress',
187
+ 'agent-task-ingress',
188
+ 'daemon-tool-catalog',
189
+ 'daemon-agent-tools',
190
+ 'session-binding',
191
+ 'conversation-submit-wait',
192
+ 'conversation-stream',
193
+ 'conversation-cancel',
194
+ 'stable-correlation',
195
+ 'remote-session-ttl',
196
+ 'homeassistant-state-read',
197
+ 'homeassistant-service-call',
198
+ 'homeassistant-event-delivery',
199
+ 'control-plane-events',
200
+ ],
201
+ events: {
202
+ outboundEventType: eventType,
203
+ inboundWebhookPath: HOME_ASSISTANT_WEBHOOK_PATH,
204
+ inboundSecretHeaders: ['x-goodvibes-homeassistant-secret', 'authorization'],
205
+ },
206
+ recommendedServices: [
207
+ { name: 'goodvibes.prompt', target: 'config_entry', description: 'Submit a normal prompt to the daemon.' },
208
+ { name: 'goodvibes.run_agent', target: 'config_entry', description: 'Run an agent task through the daemon.' },
209
+ { name: 'goodvibes.cancel', target: 'config_entry', description: 'Cancel an active run or agent by id.' },
210
+ { name: 'goodvibes.status', target: 'config_entry', description: 'Inspect daemon, session, or agent status.' },
211
+ ],
212
+ metadata: {
213
+ configKeys: [
214
+ 'surfaces.homeassistant.enabled',
215
+ 'surfaces.homeassistant.instanceUrl',
216
+ 'surfaces.homeassistant.accessToken',
217
+ 'surfaces.homeassistant.webhookSecret',
218
+ 'surfaces.homeassistant.eventType',
219
+ 'surfaces.homeassistant.remoteSessionTtlMs',
220
+ ],
221
+ remoteSessionTtlMs: Number(deps.configManager.get('surfaces.homeassistant.remoteSessionTtlMs') ?? 20 * 60_000),
222
+ },
223
+ };
224
+ }
225
+ export async function createHomeAssistantClient(deps) {
226
+ const baseUrl = resolveHomeAssistantBaseUrl(deps.configManager, deps.serviceRegistry);
227
+ if (!baseUrl) {
228
+ throw new Error('Home Assistant instance URL is not configured.');
229
+ }
230
+ const accessToken = await resolveHomeAssistantAccessToken(deps);
231
+ return new HomeAssistantIntegration({
232
+ baseUrl,
233
+ accessToken: accessToken ?? undefined,
234
+ });
235
+ }
236
+ export function resolveHomeAssistantBaseUrl(configManager, serviceRegistry) {
237
+ return firstNonEmpty(String(configManager.get('surfaces.homeassistant.instanceUrl') ?? ''), serviceRegistry?.get('homeassistant')?.baseUrl, ...HOME_ASSISTANT_URL_ENV.map((key) => process.env[key])) ?? null;
238
+ }
239
+ export async function resolveHomeAssistantAccessToken(deps) {
240
+ return await deps.serviceRegistry?.resolveSecret('homeassistant', 'primary')
241
+ || await resolveConfiguredSecret(deps, deps.configManager.get('surfaces.homeassistant.accessToken'))
242
+ || firstNonEmpty(...HOME_ASSISTANT_TOKEN_ENV.map((key) => process.env[key]))
243
+ || null;
244
+ }
245
+ export async function resolveHomeAssistantWebhookSecret(deps) {
246
+ return await deps.serviceRegistry?.resolveSecret('homeassistant', 'signingSecret')
247
+ || await resolveConfiguredSecret(deps, deps.configManager.get('surfaces.homeassistant.webhookSecret'))
248
+ || firstNonEmpty(...HOME_ASSISTANT_WEBHOOK_SECRET_ENV.map((key) => process.env[key]))
249
+ || null;
250
+ }
251
+ async function checkHomeAssistantStatus(deps) {
252
+ const baseUrl = resolveHomeAssistantBaseUrl(deps.configManager, deps.serviceRegistry);
253
+ const token = await resolveHomeAssistantAccessToken(deps);
254
+ if (!baseUrl)
255
+ return { ok: false, configured: false, error: 'Home Assistant instance URL is not configured.' };
256
+ const client = new HomeAssistantIntegration({ baseUrl, accessToken: token ?? undefined });
257
+ try {
258
+ const api = await client.getApiStatus();
259
+ return {
260
+ ok: true,
261
+ configured: Boolean(token),
262
+ baseUrl,
263
+ api,
264
+ };
265
+ }
266
+ catch (error) {
267
+ return {
268
+ ok: false,
269
+ configured: Boolean(token),
270
+ baseUrl,
271
+ error: error instanceof Error ? error.message : String(error),
272
+ };
273
+ }
274
+ }
275
+ async function listHomeAssistantStates(deps, input) {
276
+ const states = await (await createHomeAssistantClient(deps)).listStates();
277
+ const domain = readString(input?.domain)?.replace(/\.$/, '');
278
+ const query = readString(input?.query)?.toLowerCase();
279
+ const limit = clampLimit(input?.limit, 100, 500);
280
+ const filtered = states.filter((state) => {
281
+ if (domain && !state.entity_id.startsWith(`${domain}.`))
282
+ return false;
283
+ if (!query)
284
+ return true;
285
+ return state.entity_id.toLowerCase().includes(query)
286
+ || state.state.toLowerCase().includes(query)
287
+ || JSON.stringify(state.attributes ?? {}).toLowerCase().includes(query);
288
+ }).slice(0, limit);
289
+ return { ok: true, total: states.length, returned: filtered.length, states: filtered };
290
+ }
291
+ async function getHomeAssistantState(deps, input) {
292
+ const entityId = readString(input?.entityId ?? input?.entity_id);
293
+ if (!entityId)
294
+ return { ok: false, error: 'entityId is required.' };
295
+ const state = await (await createHomeAssistantClient(deps)).getState(entityId);
296
+ return state ? { ok: true, state } : { ok: false, error: `No Home Assistant state found for ${entityId}.` };
297
+ }
298
+ async function listHomeAssistantServices(deps) {
299
+ const services = await (await createHomeAssistantClient(deps)).listServices();
300
+ return { ok: true, services };
301
+ }
302
+ async function callHomeAssistantService(deps, input) {
303
+ const domain = readString(input?.domain);
304
+ const service = readString(input?.service);
305
+ if (!domain || !service)
306
+ return { ok: false, error: 'domain and service are required.' };
307
+ const serviceData = readRecord(input?.serviceData ?? input?.service_data);
308
+ const result = await (await createHomeAssistantClient(deps)).callService({
309
+ domain,
310
+ service,
311
+ ...(serviceData ? { serviceData } : {}),
312
+ ...(typeof input?.returnResponse === 'boolean' ? { returnResponse: input.returnResponse } : {}),
313
+ });
314
+ return { ok: true, result };
315
+ }
316
+ async function fireHomeAssistantEvent(deps, input) {
317
+ const eventType = readString(input?.eventType ?? input?.event_type);
318
+ if (!eventType)
319
+ return { ok: false, error: 'eventType is required.' };
320
+ const result = await (await createHomeAssistantClient(deps)).fireEvent(eventType, readRecord(input?.eventData ?? input?.event_data) ?? {});
321
+ return { ok: true, result };
322
+ }
323
+ async function renderHomeAssistantTemplate(deps, input) {
324
+ const template = readString(input?.template);
325
+ if (!template)
326
+ return { ok: false, error: 'template is required.' };
327
+ const rendered = await (await createHomeAssistantClient(deps)).renderTemplate(template, readRecord(input?.variables) ?? undefined);
328
+ return { ok: true, rendered };
329
+ }
330
+ async function publishGoodVibesEvent(deps, input) {
331
+ const body = readString(input?.body ?? input?.message ?? input?.text);
332
+ if (!body)
333
+ return { ok: false, error: 'body is required.' };
334
+ const eventType = readString(input?.eventType ?? input?.event_type)
335
+ ?? String(deps.configManager.get('surfaces.homeassistant.eventType') || HOME_ASSISTANT_DEFAULT_EVENT_TYPE);
336
+ const result = await (await createHomeAssistantClient(deps)).publishGoodVibesEvent(eventType, {
337
+ type: readString(input?.type) ?? 'message',
338
+ body,
339
+ title: readString(input?.title),
340
+ status: readString(input?.status),
341
+ metadata: readRecord(input?.metadata) ?? {},
342
+ });
343
+ return { ok: true, eventType, result };
344
+ }
345
+ async function resolveConfiguredSecret(deps, value) {
346
+ return resolveSecretInput(value, {
347
+ resolveLocalSecret: deps.secretsManager ? (key) => deps.secretsManager.get(key) : undefined,
348
+ homeDirectory: deps.secretsManager?.getGlobalHome?.() ?? undefined,
349
+ });
350
+ }
351
+ function action(surface, id, label, description, inputSchema, dangerous = false) {
352
+ return {
353
+ id,
354
+ surface,
355
+ label,
356
+ description,
357
+ dangerous,
358
+ ...(inputSchema ? { inputSchema } : {}),
359
+ metadata: { provider: 'homeassistant' },
360
+ };
361
+ }
362
+ function tool(surface, id, name, description, actionIds, inputSchema = { type: 'object', additionalProperties: false }) {
363
+ return {
364
+ id,
365
+ surface,
366
+ name,
367
+ description,
368
+ actionIds,
369
+ inputSchema,
370
+ metadata: { provider: 'homeassistant' },
371
+ };
372
+ }
373
+ function firstNonEmpty(...values) {
374
+ for (const value of values) {
375
+ if (typeof value === 'string' && value.trim().length > 0)
376
+ return value.trim();
377
+ }
378
+ return undefined;
379
+ }
380
+ function readString(value) {
381
+ return typeof value === 'string' && value.trim().length > 0 ? value.trim() : undefined;
382
+ }
383
+ function readRecord(value) {
384
+ return value && typeof value === 'object' && !Array.isArray(value)
385
+ ? value
386
+ : undefined;
387
+ }
388
+ function clampLimit(value, fallback, max) {
389
+ const parsed = typeof value === 'number' ? value : typeof value === 'string' ? Number(value) : fallback;
390
+ return Math.max(1, Math.min(max, Number.isFinite(parsed) ? Math.trunc(parsed) : fallback));
391
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/plugins.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,+BAA+B,EAC/B,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,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kBAAkB,GAClB,eAAe,CAClB,CAAC;IACF,QAAQ,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAC3D,aAAa,EACX,kBAAkB,GAClB,sBAAsB,GACtB,qBAAqB,GACrB,6BAA6B,GAC7B,eAAe,GACf,sBAAsB,GACtB,qCAAqC,GACrC,aAAa,GACb,gBAAgB,CACnB,CAAC;IACF,QAAQ,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,4BAA4B,KAAK,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC/I,QAAQ,CAAC,oBAAoB,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,4BAA4B,KAAK,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACpJ,QAAQ,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9I,QAAQ,CAAC,qBAAqB,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC;CAC9E;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,gCAAgC,GAAG,IAAI,CAyM7F"}
@@ -1,4 +1,4 @@
1
- import { handleBlueBubblesSurfaceWebhook, handleDiscordSurfaceWebhook, handleGenericWebhookSurface, handleGoogleChatSurfaceWebhook, handleIMessageSurfaceWebhook, handleMSTeamsSurfaceWebhook, handleMattermostSurfaceWebhook, handleMatrixSurfaceWebhook, handleNtfySurfaceWebhook, handleSignalSurfaceWebhook, handleSlackSurfaceWebhook, handleTelegramSurfaceWebhook, handleWhatsAppSurfaceWebhook, } from '../../adapters/index.js';
1
+ import { handleBlueBubblesSurfaceWebhook, handleDiscordSurfaceWebhook, handleGenericWebhookSurface, handleGoogleChatSurfaceWebhook, handleHomeAssistantSurfaceWebhook, handleIMessageSurfaceWebhook, handleMSTeamsSurfaceWebhook, handleMattermostSurfaceWebhook, handleMatrixSurfaceWebhook, handleNtfySurfaceWebhook, handleSignalSurfaceWebhook, handleSlackSurfaceWebhook, handleTelegramSurfaceWebhook, handleWhatsAppSurfaceWebhook, } from '../../adapters/index.js';
2
2
  export function registerBuiltinChannelPlugins(context) {
3
3
  context.deps.channelPlugins.register({
4
4
  id: 'surface:tui',
@@ -185,6 +185,7 @@ export function registerBuiltinChannelPlugins(context) {
185
185
  lookupDirectory: async (query, options) => context.lookupRouteDirectory('webhook', query, options),
186
186
  });
187
187
  registerRouterBackedPlugin(context, 'telegram', 'Telegram', ['ingress', 'egress', 'threaded_reply', 'interactive_actions', 'account_lifecycle', 'target_resolution', 'agent_tools'], '/webhook/telegram', handleTelegramSurfaceWebhook);
188
+ registerRouterBackedPlugin(context, 'homeassistant', 'Home Assistant', ['ingress', 'egress', 'threaded_reply', 'interactive_actions', 'session_binding', 'account_lifecycle', 'target_resolution', 'agent_tools'], '/webhook/homeassistant', handleHomeAssistantSurfaceWebhook);
188
189
  registerRouterBackedPlugin(context, 'google-chat', 'Google Chat', ['ingress', 'egress', 'threaded_reply', 'interactive_actions', 'account_lifecycle', 'target_resolution', 'agent_tools'], '/webhook/google-chat', handleGoogleChatSurfaceWebhook);
189
190
  registerRouterBackedPlugin(context, 'signal', 'Signal', ['ingress', 'egress', 'account_lifecycle', 'target_resolution', 'agent_tools'], '/webhook/signal', handleSignalSurfaceWebhook);
190
191
  registerRouterBackedPlugin(context, 'whatsapp', 'WhatsApp', ['ingress', 'egress', 'interactive_actions', 'account_lifecycle', 'target_resolution', 'agent_tools'], '/webhook/whatsapp', handleWhatsAppSurfaceWebhook);
@@ -1 +1 @@
1
- {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEvE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,cAAc,GAAG,mBAAmB,CAmChF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAiCtE"}
1
+ {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEvE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,cAAc,GAAG,mBAAmB,CAqChF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAmCtE"}
@@ -27,6 +27,8 @@ export function renderBuiltinPolicy(surface) {
27
27
  return { ...base, reasoningVisibility: 'suppress', format: 'plain', supportsThreads: false, maxChunkChars: 1_600 };
28
28
  case 'webhook':
29
29
  return { ...base, reasoningVisibility: 'private', format: 'json', supportsThreads: false, maxChunkChars: 12_000 };
30
+ case 'homeassistant':
31
+ return { ...base, reasoningVisibility: 'summary', format: 'json', supportsThreads: true, maxChunkChars: 8_000 };
30
32
  case 'signal':
31
33
  case 'whatsapp':
32
34
  case 'imessage':
@@ -48,6 +50,8 @@ export function surfaceLabelForBuiltin(surface) {
48
50
  return 'ntfy';
49
51
  case 'webhook':
50
52
  return 'Generic webhook';
53
+ case 'homeassistant':
54
+ return 'Home Assistant';
51
55
  case 'telegram':
52
56
  return 'Telegram';
53
57
  case 'google-chat':
@@ -1 +1 @@
1
- {"version":3,"file":"rendering.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/rendering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAE7D,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,qBAAqB,EAAE,CAAC;IACzE,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAClH;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAwB9B;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,cAAc,GACtB,SAAS,IAAI,EAAE,CA0BjB"}
1
+ {"version":3,"file":"rendering.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/rendering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAE7D,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,qBAAqB,EAAE,CAAC;IACzE,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAClH;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA+B9B;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,cAAc,GACtB,SAAS,IAAI,EAAE,CA0BjB"}
@@ -8,9 +8,16 @@ export async function renderBuiltinChannelEvent(context, surface, request) {
8
8
  jobId: binding?.jobId ?? request.routeId ?? `channel:${surface}`,
9
9
  runId: binding?.runId ?? request.agentId ?? request.sessionId ?? `${surface}:${Date.now()}`,
10
10
  ...(request.agentId ? { agentId: request.agentId } : {}),
11
+ ...(request.sessionId ? { sessionId: request.sessionId } : {}),
11
12
  status: renderStatus(request),
12
13
  includeLinks: request.phase !== 'progress',
13
14
  ...(binding ? { binding: toDeliveryRouteBinding(binding) } : {}),
15
+ metadata: {
16
+ phase: request.phase,
17
+ pending: request.pending ?? {},
18
+ renderMetadata: request.metadata,
19
+ eventKinds: request.events.map((event) => event.kind),
20
+ },
14
21
  });
15
22
  return {
16
23
  delivered: true,
@@ -1 +1 @@
1
- {"version":3,"file":"setup-schema.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/setup-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,kBAAkB,EAClB,cAAc,EACf,MAAM,aAAa,CAAC;AAMrB,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,kBAAkB,CA6cjF"}
1
+ {"version":3,"file":"setup-schema.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/setup-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,kBAAkB,EAClB,cAAc,EACf,MAAM,aAAa,CAAC;AAUrB,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,kBAAkB,CAigBjF"}
@@ -1,4 +1,5 @@
1
1
  import { CHANNEL_SETUP_VERSION, DEFAULT_SECRET_BACKENDS, } from './shared.js';
2
+ import { HOME_ASSISTANT_DEFAULT_EVENT_TYPE, HOME_ASSISTANT_WEBHOOK_PATH, } from './homeassistant.js';
2
3
  export function getBuiltinSetupSchema(surface) {
3
4
  switch (surface) {
4
5
  case 'tui':
@@ -167,6 +168,58 @@ export function getBuiltinSetupSchema(surface) {
167
168
  ],
168
169
  metadata: {},
169
170
  };
171
+ case 'homeassistant':
172
+ return {
173
+ surface,
174
+ version: CHANNEL_SETUP_VERSION,
175
+ label: 'Home Assistant',
176
+ setupMode: 'bridge',
177
+ description: 'Home Assistant is a daemon/device surface with signed inbound callbacks, daemon event delivery, and Home Assistant REST-backed tools.',
178
+ fields: [
179
+ setupField('enabled', 'Enabled', 'boolean', false, { configKey: 'surfaces.homeassistant.enabled', defaultValue: false }),
180
+ setupField('instanceUrl', 'Instance URL', 'url', false, { configKey: 'surfaces.homeassistant.instanceUrl', placeholder: 'http://homeassistant.local:8123' }),
181
+ setupField('accessToken', 'Long-lived access token', 'secret', false, { configKey: 'surfaces.homeassistant.accessToken', secretTargetId: 'primary' }),
182
+ setupField('webhookSecret', 'Webhook secret', 'secret', true, { configKey: 'surfaces.homeassistant.webhookSecret', secretTargetId: 'signingSecret' }),
183
+ setupField('defaultConversationId', 'Default conversation id', 'string', false, { configKey: 'surfaces.homeassistant.defaultConversationId', defaultValue: 'goodvibes' }),
184
+ setupField('deviceId', 'Device id', 'string', false, { configKey: 'surfaces.homeassistant.deviceId', defaultValue: 'goodvibes-daemon' }),
185
+ setupField('deviceName', 'Device name', 'string', false, { configKey: 'surfaces.homeassistant.deviceName', defaultValue: 'GoodVibes Daemon' }),
186
+ setupField('eventType', 'Event type', 'string', false, { configKey: 'surfaces.homeassistant.eventType', defaultValue: HOME_ASSISTANT_DEFAULT_EVENT_TYPE }),
187
+ setupField('remoteSessionTtlMs', 'Remote session idle TTL', 'number', false, { configKey: 'surfaces.homeassistant.remoteSessionTtlMs', defaultValue: 20 * 60_000 }),
188
+ ],
189
+ secretTargets: [
190
+ secretTarget(surface, 'primary', 'Long-lived access token', false, 'Used by GoodVibes to read Home Assistant states, call services, render templates, and fire events.', {
191
+ serviceName: 'homeassistant',
192
+ serviceField: 'primary',
193
+ envKeys: ['HOMEASSISTANT_ACCESS_TOKEN', 'HOME_ASSISTANT_ACCESS_TOKEN', 'HA_ACCESS_TOKEN'],
194
+ configKeys: ['surfaces.homeassistant.accessToken'],
195
+ }),
196
+ secretTarget(surface, 'signingSecret', 'Webhook secret', true, 'Used to verify Home Assistant-originated callbacks before daemon auth is evaluated.', {
197
+ serviceName: 'homeassistant',
198
+ serviceField: 'signingSecret',
199
+ envKeys: ['HOMEASSISTANT_WEBHOOK_SECRET', 'HOME_ASSISTANT_WEBHOOK_SECRET', 'HA_GOODVIBES_WEBHOOK_SECRET'],
200
+ configKeys: ['surfaces.homeassistant.webhookSecret'],
201
+ }),
202
+ ],
203
+ externalSteps: [
204
+ 'Create the Home Assistant custom integration with config_flow enabled and a single config entry for this daemon.',
205
+ 'Configure the integration with the daemon base URL and operator bearer token.',
206
+ 'Use /api/homeassistant/conversation for Assist conversation agents that need a final reply in the request/response cycle.',
207
+ 'Use /api/homeassistant/conversation/stream when the integration wants progress events before the final response.',
208
+ `Send Home Assistant-originated prompts to ${HOME_ASSISTANT_WEBHOOK_PATH} with x-goodvibes-homeassistant-secret or Authorization: Bearer <webhookSecret>.`,
209
+ 'Subscribe the Home Assistant integration to the configured GoodVibes event type to update entities and service-call responses.',
210
+ 'Use the channel tool catalog endpoints to expose daemon tools and agent tools as Home Assistant service actions.',
211
+ ],
212
+ metadata: {
213
+ protocolVersion: 1,
214
+ webhookPath: HOME_ASSISTANT_WEBHOOK_PATH,
215
+ conversationPath: '/api/homeassistant/conversation',
216
+ conversationStreamPath: '/api/homeassistant/conversation/stream',
217
+ conversationCancelPath: '/api/homeassistant/conversation/cancel',
218
+ eventTypeDefault: HOME_ASSISTANT_DEFAULT_EVENT_TYPE,
219
+ remoteSessionTtlMsDefault: 20 * 60_000,
220
+ manifestAction: 'homeassistant-manifest',
221
+ },
222
+ };
170
223
  case 'telegram':
171
224
  return {
172
225
  surface,
@@ -10,7 +10,7 @@ import type { ChannelPolicyManager } from '../policy-manager.js';
10
10
  import type { ChannelPluginRegistry } from '../plugin-registry.js';
11
11
  import type { ChannelProviderRuntimeManager } from '../provider-runtime.js';
12
12
  import type { RouteBindingManager } from '../route-manager.js';
13
- export type ManagedSurface = 'slack' | 'discord' | 'ntfy' | 'webhook' | 'telegram' | 'google-chat' | 'signal' | 'whatsapp' | 'imessage' | 'msteams' | 'bluebubbles' | 'mattermost' | 'matrix';
13
+ export type ManagedSurface = 'slack' | 'discord' | 'ntfy' | 'webhook' | 'homeassistant' | 'telegram' | 'google-chat' | 'signal' | 'whatsapp' | 'imessage' | 'msteams' | 'bluebubbles' | 'mattermost' | 'matrix';
14
14
  export interface BuiltinChannelRuntimeDeps {
15
15
  readonly configManager: ConfigManager;
16
16
  readonly secretsManager: SecretsManager;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,GACT,UAAU,GACV,aAAa,GACb,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,GACT,aAAa,GACb,YAAY,GACZ,QAAQ,CAAC;AAEb,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IA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C,IAAI,CAAC,CAAC;IACrF,QAAQ,CAAC,wBAAwB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF,QAAQ,CAAC,0BAA0B,EAAE,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxH,QAAQ,CAAC,4BAA4B,EAAE,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1H,QAAQ,CAAC,yBAAyB,EAAE,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvH,QAAQ,CAAC,4BAA4B,EAAE,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3H;AAED,KAAK,oBAAoB,GAAG,MAAM,cAAc,CAAC;AAEjD,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,uBAAuB,0IAU1B,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc,GAAG,oBAAoB,CA+BrF"}
@@ -20,6 +20,8 @@ export function configSectionForSurface(surface) {
20
20
  return 'ntfy';
21
21
  case 'webhook':
22
22
  return 'webhook';
23
+ case 'homeassistant':
24
+ return 'homeassistant';
23
25
  case 'telegram':
24
26
  return 'telegram';
25
27
  case 'google-chat':
@@ -1 +1 @@
1
- {"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/surfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD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AAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAE/G;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAI1E;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAOlG;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAOlG;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAOpG;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAO9F"}
@@ -7,6 +7,7 @@ export function isManagedSurface(surface) {
7
7
  || surface === 'discord'
8
8
  || surface === 'ntfy'
9
9
  || surface === 'webhook'
10
+ || surface === 'homeassistant'
10
11
  || surface === 'telegram'
11
12
  || surface === 'google-chat'
12
13
  || surface === 'signal'
@@ -1 +1 @@
1
- {"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/targets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAE5B,qBAAqB,EACrB,cAAc,EACd,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7E,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;CAC1C;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAsCvC;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,2BAA2B,GACpC,qBAAqB,GAAG,IAAI,CA0E9B;AAED,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,2BAA2B,GACpC,uBAAuB,CAUzB;AAED,wBAAsB,0CAA0C,CAC9D,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAe3C;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAIjF;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,4BAA4B,GACrC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAWlC;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,4BAA4B,GACrC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAkSlC"}
1
+ {"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/channels/builtin/targets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAE5B,qBAAqB,EACrB,cAAc,EACd,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7E,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;CAC1C;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAsCvC;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,2BAA2B,GACpC,qBAAqB,GAAG,IAAI,CA0E9B;AAED,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,2BAA2B,GACpC,uBAAuB,CAUzB;AAED,wBAAsB,0CAA0C,CAC9D,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAe3C;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAIjF;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,4BAA4B,GACrC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAWlC;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,4BAA4B,GACrC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CA2TlC"}
@@ -298,6 +298,30 @@ export async function lookupBuiltinProviderDirectory(context, surface, query, op
298
298
  metadata: { provider: 'ntfy', baseUrl: context.deps.configManager.get('surfaces.ntfy.baseUrl') },
299
299
  }], needle, limit);
300
300
  }
301
+ if (surface === 'homeassistant') {
302
+ const conversationId = surfaces.homeassistant.defaultConversationId || surfaces.homeassistant.deviceId || 'goodvibes';
303
+ const candidates = [{
304
+ id: conversationId,
305
+ surface,
306
+ kind: 'service',
307
+ label: surfaces.homeassistant.deviceName || 'GoodVibes Daemon',
308
+ handle: conversationId,
309
+ groupId: conversationId,
310
+ isGroupConversation: false,
311
+ searchText: [
312
+ conversationId,
313
+ surfaces.homeassistant.deviceId,
314
+ surfaces.homeassistant.deviceName,
315
+ surfaces.homeassistant.instanceUrl,
316
+ ].filter(Boolean).join(' '),
317
+ metadata: {
318
+ provider: 'homeassistant',
319
+ instanceUrl: surfaces.homeassistant.instanceUrl,
320
+ eventType: surfaces.homeassistant.eventType,
321
+ },
322
+ }];
323
+ return filterProviderDirectory(candidates, needle, limit);
324
+ }
301
325
  if (surface === 'telegram') {
302
326
  const candidates = [];
303
327
  if (surfaces.telegram.defaultChatId) {