@pellux/goodvibes-sdk 0.25.1 → 0.25.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/daemon/otlp-protobuf.d.ts +3 -0
- package/dist/_internal/daemon/otlp-protobuf.d.ts.map +1 -0
- package/dist/_internal/daemon/otlp-protobuf.js +968 -0
- package/dist/_internal/daemon/telemetry-routes.d.ts.map +1 -1
- package/dist/_internal/daemon/telemetry-routes.js +22 -13
- package/dist/_internal/platform/adapters/ntfy/index.d.ts.map +1 -1
- package/dist/_internal/platform/adapters/ntfy/index.js +93 -0
- package/dist/_internal/platform/adapters/types.d.ts +21 -0
- package/dist/_internal/platform/adapters/types.d.ts.map +1 -1
- package/dist/_internal/platform/channels/builtin/setup-schema.d.ts.map +1 -1
- package/dist/_internal/platform/channels/builtin/setup-schema.js +4 -3
- package/dist/_internal/platform/channels/delivery/strategies-core.d.ts.map +1 -1
- package/dist/_internal/platform/channels/delivery/strategies-core.js +1 -0
- package/dist/_internal/platform/channels/provider-runtime.d.ts +1 -1
- package/dist/_internal/platform/channels/provider-runtime.d.ts.map +1 -1
- package/dist/_internal/platform/channels/provider-runtime.js +14 -9
- package/dist/_internal/platform/channels/reply-pipeline.d.ts +1 -0
- package/dist/_internal/platform/channels/reply-pipeline.d.ts.map +1 -1
- package/dist/_internal/platform/channels/reply-pipeline.js +32 -1
- package/dist/_internal/platform/companion/companion-chat-manager.d.ts +12 -0
- package/dist/_internal/platform/companion/companion-chat-manager.d.ts.map +1 -1
- package/dist/_internal/platform/companion/companion-chat-manager.js +41 -0
- package/dist/_internal/platform/config/schema-domain-surfaces.js +1 -1
- package/dist/_internal/platform/control-plane/conversation-message.d.ts +1 -1
- package/dist/_internal/platform/control-plane/conversation-message.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade-composition.js +3 -0
- package/dist/_internal/platform/daemon/surface-actions.d.ts +21 -1
- package/dist/_internal/platform/daemon/surface-actions.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/surface-actions.js +184 -0
- package/dist/_internal/platform/daemon/surface-delivery.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/surface-delivery.js +2 -0
- package/dist/_internal/platform/integrations/index.d.ts +1 -1
- package/dist/_internal/platform/integrations/index.d.ts.map +1 -1
- package/dist/_internal/platform/integrations/index.js +1 -1
- package/dist/_internal/platform/integrations/ntfy.d.ts +11 -0
- package/dist/_internal/platform/integrations/ntfy.d.ts.map +1 -1
- package/dist/_internal/platform/integrations/ntfy.js +266 -30
- package/dist/_internal/platform/providers/registry.d.ts +1 -0
- package/dist/_internal/platform/providers/registry.d.ts.map +1 -1
- package/dist/_internal/platform/providers/registry.js +15 -5
- package/dist/_internal/platform/runtime/emitters/agents.d.ts +3 -0
- package/dist/_internal/platform/runtime/emitters/agents.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/events/agents.d.ts +3 -0
- package/dist/_internal/platform/runtime/events/agents.d.ts.map +1 -1
- package/dist/_internal/platform/tools/agent/manager.d.ts.map +1 -1
- package/dist/_internal/platform/tools/agent/manager.js +3 -0
- package/dist/_internal/platform/version.js +1 -1
- package/package.json +1 -1
- package/dist/_internal/platform/runtime/contracts/index.d.ts +0 -40
- package/dist/_internal/platform/runtime/contracts/index.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/index.js +0 -133
- package/dist/_internal/platform/runtime/contracts/migrations/index.d.ts +0 -75
- package/dist/_internal/platform/runtime/contracts/migrations/index.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/migrations/index.js +0 -158
- package/dist/_internal/platform/runtime/contracts/migrations/schemas.d.ts +0 -57
- package/dist/_internal/platform/runtime/contracts/migrations/schemas.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/migrations/schemas.js +0 -157
- package/dist/_internal/platform/runtime/contracts/types.d.ts +0 -123
- package/dist/_internal/platform/runtime/contracts/types.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/types.js +0 -41
- package/dist/_internal/platform/runtime/contracts/validators/event-envelope.d.ts +0 -24
- package/dist/_internal/platform/runtime/contracts/validators/event-envelope.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/validators/event-envelope.js +0 -104
- package/dist/_internal/platform/runtime/contracts/validators/index.d.ts +0 -11
- package/dist/_internal/platform/runtime/contracts/validators/index.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/validators/index.js +0 -10
- package/dist/_internal/platform/runtime/contracts/validators/runtime-state.d.ts +0 -23
- package/dist/_internal/platform/runtime/contracts/validators/runtime-state.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/validators/runtime-state.js +0 -101
- package/dist/_internal/platform/runtime/contracts/validators/session.d.ts +0 -24
- package/dist/_internal/platform/runtime/contracts/validators/session.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/validators/session.js +0 -103
- package/dist/_internal/platform/runtime/contracts/version.d.ts +0 -84
- package/dist/_internal/platform/runtime/contracts/version.d.ts.map +0 -1
- package/dist/_internal/platform/runtime/contracts/version.js +0 -41
|
@@ -201,7 +201,7 @@ export const surfaceConfigSettings = [
|
|
|
201
201
|
key: 'surfaces.ntfy.topic',
|
|
202
202
|
type: 'string',
|
|
203
203
|
default: '',
|
|
204
|
-
description: '
|
|
204
|
+
description: 'Optional default ntfy topic for outbound notifications; inbound runtime also subscribes to SDK-owned goodvibes-chat, goodvibes-agent, and goodvibes-ntfy topics',
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
key: 'surfaces.ntfy.token',
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Used both for chat-mode (where the SDK owns the ConversationManager)
|
|
12
12
|
* and for companion follow-ups (where the TUI client owns it cross-process).
|
|
13
13
|
*/
|
|
14
|
-
export type MessageSource = 'operator' | 'companion-chat-user' | 'companion-chat-assistant' | 'companion-followup' | 'system' | 'tool';
|
|
14
|
+
export type MessageSource = 'operator' | 'companion-chat-user' | 'companion-chat-assistant' | 'companion-followup' | 'ntfy-chat' | 'system' | 'tool';
|
|
15
15
|
/**
|
|
16
16
|
* Stable envelope shape for any conversation-message-related event published
|
|
17
17
|
* through the control-plane gateway. All consumers (SSE companion chat stream,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-message.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/control-plane/conversation-message.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,qBAAqB,GACrB,0BAA0B,GAC1B,oBAAoB,GACpB,QAAQ,GACR,MAAM,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD"}
|
|
1
|
+
{"version":3,"file":"conversation-message.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/control-plane/conversation-message.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,qBAAqB,GACrB,0BAA0B,GAC1B,oBAAoB,GACpB,WAAW,GACX,QAAQ,GACR,MAAM,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAiBrD,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,wCAAwC,CAAC;AAI3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAIpE,YAAY,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,GACvC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,EACvC,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,oBAAoB,CA2FvG;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,EACpB,qBAAqB,CAAC,EAAE,aAAa,GACpC,2BAA2B,CAoI7B;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,yBAAyB,
|
|
1
|
+
{"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AA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AAS,CAAC,EAAE,MAAM,CAAC;KAC7B,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAoBP"}
|
|
@@ -282,6 +282,9 @@ export function createDaemonFacadeCollaborators(options) {
|
|
|
282
282
|
routeBindings: runtime.routeBindings,
|
|
283
283
|
sessionBroker: runtime.sessionBroker,
|
|
284
284
|
channelPolicy: runtime.channelPolicy,
|
|
285
|
+
controlPlaneGateway: runtime.controlPlaneGateway,
|
|
286
|
+
runtimeBus: runtime.runtimeBus,
|
|
287
|
+
companionChatManager: runtime.companionChatManager,
|
|
285
288
|
automationManager: runtime.automationManager,
|
|
286
289
|
agentManager: runtime.agentManager,
|
|
287
290
|
trySpawnAgent: options.trySpawnAgent,
|
|
@@ -2,17 +2,22 @@ import type { ConfigManager } from '../config/manager.js';
|
|
|
2
2
|
import type { ServiceRegistry } from '../config/service-registry.js';
|
|
3
3
|
import type { AgentRecord } from '../tools/agent/index.js';
|
|
4
4
|
import type { AgentManager } from '../tools/agent/index.js';
|
|
5
|
-
import type { SharedSessionBroker } from '../control-plane/index.js';
|
|
5
|
+
import type { ControlPlaneGateway, SharedSessionBroker } from '../control-plane/index.js';
|
|
6
6
|
import type { RouteBindingManager, ChannelPolicyManager } from '../channels/index.js';
|
|
7
7
|
import type { GenericWebhookAdapterContext, SurfaceAdapterContext } from '../adapters/index.js';
|
|
8
8
|
import type { AutomationManager } from '../automation/index.js';
|
|
9
9
|
import type { ChannelPolicyDecision, ChannelIngressPolicyInput } from '../channels/index.js';
|
|
10
|
+
import type { RuntimeEventBus } from '../runtime/events/index.js';
|
|
11
|
+
import type { CompanionChatManager } from '../companion/companion-chat-manager.js';
|
|
10
12
|
interface DaemonSurfaceActionContext {
|
|
11
13
|
readonly serviceRegistry: ServiceRegistry;
|
|
12
14
|
readonly configManager: ConfigManager;
|
|
13
15
|
readonly routeBindings: RouteBindingManager;
|
|
14
16
|
readonly sessionBroker: SharedSessionBroker;
|
|
15
17
|
readonly channelPolicy: ChannelPolicyManager;
|
|
18
|
+
readonly controlPlaneGateway: ControlPlaneGateway;
|
|
19
|
+
readonly runtimeBus: RuntimeEventBus;
|
|
20
|
+
readonly companionChatManager: CompanionChatManager | null;
|
|
16
21
|
readonly automationManager: AutomationManager;
|
|
17
22
|
readonly agentManager: AgentManager;
|
|
18
23
|
readonly trySpawnAgent: (input: Parameters<AgentManager['spawn']>[0], logLabel?: string, sessionId?: string) => AgentRecord | Response;
|
|
@@ -36,6 +41,10 @@ interface DaemonSurfaceActionContext {
|
|
|
36
41
|
}
|
|
37
42
|
export declare class DaemonSurfaceActionHelper {
|
|
38
43
|
private readonly context;
|
|
44
|
+
private static readonly NTFY_CHAT_REPLY_TTL_MS;
|
|
45
|
+
private readonly pendingNtfyChatReplies;
|
|
46
|
+
private ntfyChatReplyUnsubscribers;
|
|
47
|
+
private ntfyRemoteSessionId;
|
|
39
48
|
constructor(context: DaemonSurfaceActionContext);
|
|
40
49
|
buildSurfaceAdapterContext(): SurfaceAdapterContext;
|
|
41
50
|
buildGenericWebhookAdapterContext(): GenericWebhookAdapterContext;
|
|
@@ -49,6 +58,17 @@ export declare class DaemonSurfaceActionHelper {
|
|
|
49
58
|
readonly id: string;
|
|
50
59
|
}): Promise<string>;
|
|
51
60
|
performInteractiveSurfaceAction(actionId: string, surface: 'slack' | 'discord', req: Request): Promise<string>;
|
|
61
|
+
private publishConversationFollowup;
|
|
62
|
+
private queueNtfyChatReply;
|
|
63
|
+
private ensureNtfyChatReplyListeners;
|
|
64
|
+
private matchNtfyChatReplyTurn;
|
|
65
|
+
private deliverNtfyChatReply;
|
|
66
|
+
private takeNtfyChatReply;
|
|
67
|
+
private cleanupExpiredNtfyChatReplies;
|
|
68
|
+
private postNtfyRemoteChatMessage;
|
|
69
|
+
private runNtfyRemoteChatTurn;
|
|
70
|
+
private publishNtfyReply;
|
|
71
|
+
private resolveNtfyToken;
|
|
52
72
|
}
|
|
53
73
|
export {};
|
|
54
74
|
//# sourceMappingURL=surface-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface-actions.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/surface-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"surface-actions.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/surface-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAa,MAAM,4BAA4B,CAAC;AAG7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAcnF,UAAU,0BAA0B;I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CAAA;KAAE,GAAG,IAAI;IAUlH,4BAA4B,CAChC,OAAO,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAC/E,OAAO,CAAC,MAAM,CAAC;IAmDZ,+BAA+B,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,MAAM,CAAC;IAkClB,OAAO,CAAC,2BAA2B;IAsBnC,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,4BAA4B;IAkCpC,OAAO,CAAC,sBAAsB;YAWhB,oBAAoB;IAmBlC,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,6BAA6B;YAWvB,yBAAyB;YAyDzB,qBAAqB;YAiCrB,gBAAgB;YAYhB,gBAAgB;CAM/B"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { emitCompanionMessageReceived } from '../runtime/emitters/index.js';
|
|
2
|
+
import { NtfyIntegration } from '../integrations/ntfy.js';
|
|
3
|
+
import { logger } from '../utils/logger.js';
|
|
4
|
+
import { summarizeError } from '../utils/error-display.js';
|
|
1
5
|
export class DaemonSurfaceActionHelper {
|
|
2
6
|
context;
|
|
7
|
+
static NTFY_CHAT_REPLY_TTL_MS = 10 * 60_000;
|
|
8
|
+
pendingNtfyChatReplies = new Map();
|
|
9
|
+
ntfyChatReplyUnsubscribers = [];
|
|
10
|
+
ntfyRemoteSessionId = null;
|
|
3
11
|
constructor(context) {
|
|
4
12
|
this.context = context;
|
|
5
13
|
}
|
|
@@ -15,6 +23,9 @@ export class DaemonSurfaceActionHelper {
|
|
|
15
23
|
performInteractiveSurfaceAction: (actionId, surface, request) => this.performInteractiveSurfaceAction(actionId, surface, request),
|
|
16
24
|
trySpawnAgent: (input, logLabel, sessionId) => this.context.trySpawnAgent(input, logLabel, sessionId),
|
|
17
25
|
queueSurfaceReplyFromBinding: (binding, input) => this.context.queueSurfaceReplyFromBinding(binding, input),
|
|
26
|
+
publishConversationFollowup: (sessionId, envelope) => this.publishConversationFollowup(sessionId, envelope),
|
|
27
|
+
queueNtfyChatReply: (input) => this.queueNtfyChatReply(input),
|
|
28
|
+
postNtfyRemoteChatMessage: (input) => this.postNtfyRemoteChatMessage(input),
|
|
18
29
|
};
|
|
19
30
|
}
|
|
20
31
|
buildGenericWebhookAdapterContext() {
|
|
@@ -121,4 +132,177 @@ export class DaemonSurfaceActionHelper {
|
|
|
121
132
|
}
|
|
122
133
|
return `No handler for ${surface} action ${actionId}`;
|
|
123
134
|
}
|
|
135
|
+
publishConversationFollowup(sessionId, envelope) {
|
|
136
|
+
this.context.controlPlaneGateway.publishEvent('conversation.followup.companion', { sessionId, ...envelope }, { clientKind: 'tui' });
|
|
137
|
+
emitCompanionMessageReceived(this.context.runtimeBus, { sessionId, traceId: `ntfy:${envelope.messageId}`, source: 'ntfy-chat' }, {
|
|
138
|
+
sessionId,
|
|
139
|
+
messageId: envelope.messageId,
|
|
140
|
+
body: envelope.body,
|
|
141
|
+
source: envelope.source,
|
|
142
|
+
timestamp: envelope.timestamp,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
queueNtfyChatReply(input) {
|
|
146
|
+
this.ensureNtfyChatReplyListeners();
|
|
147
|
+
this.cleanupExpiredNtfyChatReplies();
|
|
148
|
+
const bucket = this.pendingNtfyChatReplies.get(input.sessionId) ?? [];
|
|
149
|
+
bucket.push({
|
|
150
|
+
...input,
|
|
151
|
+
createdAt: Date.now(),
|
|
152
|
+
});
|
|
153
|
+
this.pendingNtfyChatReplies.set(input.sessionId, bucket);
|
|
154
|
+
}
|
|
155
|
+
ensureNtfyChatReplyListeners() {
|
|
156
|
+
if (this.ntfyChatReplyUnsubscribers.length > 0)
|
|
157
|
+
return;
|
|
158
|
+
this.ntfyChatReplyUnsubscribers = [
|
|
159
|
+
this.context.runtimeBus.on('TURN_SUBMITTED', (envelope) => this.matchNtfyChatReplyTurn(envelope.sessionId, envelope.payload.turnId, envelope.payload.prompt)),
|
|
160
|
+
this.context.runtimeBus.on('TURN_COMPLETED', (envelope) => {
|
|
161
|
+
void this.deliverNtfyChatReply(envelope.sessionId, envelope.payload.turnId, envelope.payload.response);
|
|
162
|
+
}),
|
|
163
|
+
this.context.runtimeBus.on('TURN_ERROR', (envelope) => {
|
|
164
|
+
void this.deliverNtfyChatReply(envelope.sessionId, envelope.payload.turnId, `Error: ${envelope.payload.error}`);
|
|
165
|
+
}),
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
matchNtfyChatReplyTurn(sessionId, turnId, prompt) {
|
|
169
|
+
this.cleanupExpiredNtfyChatReplies();
|
|
170
|
+
const bucket = this.pendingNtfyChatReplies.get(sessionId);
|
|
171
|
+
if (!bucket)
|
|
172
|
+
return;
|
|
173
|
+
const normalizedPrompt = prompt.trim();
|
|
174
|
+
const pending = bucket.find((entry) => !entry.turnId && entry.body.trim() === normalizedPrompt);
|
|
175
|
+
if (pending) {
|
|
176
|
+
pending.turnId = turnId;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async deliverNtfyChatReply(sessionId, turnId, message) {
|
|
180
|
+
const pending = this.takeNtfyChatReply(sessionId, turnId);
|
|
181
|
+
if (!pending)
|
|
182
|
+
return;
|
|
183
|
+
try {
|
|
184
|
+
await this.publishNtfyReply(pending.topic, message.trim() || '(empty response)', pending.title ?? 'GoodVibes chat');
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
logger.warn('DaemonSurfaceActionHelper: failed to publish ntfy chat reply', {
|
|
188
|
+
sessionId,
|
|
189
|
+
turnId,
|
|
190
|
+
topic: pending.topic,
|
|
191
|
+
error: summarizeError(error),
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
takeNtfyChatReply(sessionId, turnId) {
|
|
196
|
+
const bucket = this.pendingNtfyChatReplies.get(sessionId);
|
|
197
|
+
if (!bucket)
|
|
198
|
+
return null;
|
|
199
|
+
const index = bucket.findIndex((entry) => entry.turnId === turnId);
|
|
200
|
+
if (index < 0)
|
|
201
|
+
return null;
|
|
202
|
+
const [pending] = bucket.splice(index, 1);
|
|
203
|
+
if (bucket.length === 0) {
|
|
204
|
+
this.pendingNtfyChatReplies.delete(sessionId);
|
|
205
|
+
}
|
|
206
|
+
return pending ?? null;
|
|
207
|
+
}
|
|
208
|
+
cleanupExpiredNtfyChatReplies(now = Date.now()) {
|
|
209
|
+
for (const [sessionId, bucket] of this.pendingNtfyChatReplies.entries()) {
|
|
210
|
+
const fresh = bucket.filter((entry) => now - entry.createdAt < DaemonSurfaceActionHelper.NTFY_CHAT_REPLY_TTL_MS);
|
|
211
|
+
if (fresh.length === 0) {
|
|
212
|
+
this.pendingNtfyChatReplies.delete(sessionId);
|
|
213
|
+
}
|
|
214
|
+
else if (fresh.length !== bucket.length) {
|
|
215
|
+
this.pendingNtfyChatReplies.set(sessionId, fresh);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
async postNtfyRemoteChatMessage(input) {
|
|
220
|
+
const manager = this.context.companionChatManager;
|
|
221
|
+
if (!manager) {
|
|
222
|
+
return {
|
|
223
|
+
sessionId: '',
|
|
224
|
+
messageId: '',
|
|
225
|
+
delivered: false,
|
|
226
|
+
error: 'ntfy remote chat manager is unavailable',
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
let sessionId = this.ntfyRemoteSessionId ?? '';
|
|
230
|
+
try {
|
|
231
|
+
await manager.init();
|
|
232
|
+
let session = sessionId ? manager.getSession(sessionId) : null;
|
|
233
|
+
if (!session || session.status === 'closed') {
|
|
234
|
+
session = manager.createSession({
|
|
235
|
+
title: input.title ?? 'GoodVibes ntfy',
|
|
236
|
+
});
|
|
237
|
+
this.ntfyRemoteSessionId = session.id;
|
|
238
|
+
}
|
|
239
|
+
sessionId = session.id;
|
|
240
|
+
void this.runNtfyRemoteChatTurn(manager, sessionId, input).catch((error) => {
|
|
241
|
+
logger.warn('DaemonSurfaceActionHelper: ntfy remote chat turn failed', {
|
|
242
|
+
sessionId,
|
|
243
|
+
topic: input.topic,
|
|
244
|
+
error: summarizeError(error),
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
return {
|
|
248
|
+
sessionId,
|
|
249
|
+
messageId: '',
|
|
250
|
+
delivered: true,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
const errorMessage = summarizeError(error);
|
|
255
|
+
try {
|
|
256
|
+
await this.publishNtfyReply(input.topic, `Error: ${errorMessage}`, input.title ?? 'GoodVibes ntfy');
|
|
257
|
+
}
|
|
258
|
+
catch (publishError) {
|
|
259
|
+
logger.warn('DaemonSurfaceActionHelper: failed to publish ntfy remote chat error', {
|
|
260
|
+
topic: input.topic,
|
|
261
|
+
error: summarizeError(publishError),
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
sessionId,
|
|
266
|
+
messageId: '',
|
|
267
|
+
delivered: false,
|
|
268
|
+
error: errorMessage,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
async runNtfyRemoteChatTurn(manager, sessionId, input) {
|
|
273
|
+
try {
|
|
274
|
+
const result = await manager.postMessageAndWaitForReply(sessionId, input.body, `ntfy:${input.topic}`, { timeoutMs: 120_000 });
|
|
275
|
+
const response = result.response?.trim();
|
|
276
|
+
const resultError = result.error ?? (response ? undefined : 'No response from ntfy remote chat');
|
|
277
|
+
const outbound = response || `Error: ${resultError}`;
|
|
278
|
+
await this.publishNtfyReply(input.topic, outbound, input.title ?? 'GoodVibes ntfy');
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
const errorMessage = summarizeError(error);
|
|
282
|
+
try {
|
|
283
|
+
await this.publishNtfyReply(input.topic, `Error: ${errorMessage}`, input.title ?? 'GoodVibes ntfy');
|
|
284
|
+
}
|
|
285
|
+
catch (publishError) {
|
|
286
|
+
logger.warn('DaemonSurfaceActionHelper: failed to publish ntfy remote chat error', {
|
|
287
|
+
topic: input.topic,
|
|
288
|
+
error: summarizeError(publishError),
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async publishNtfyReply(topic, message, title) {
|
|
294
|
+
if (!topic || !message.trim())
|
|
295
|
+
return;
|
|
296
|
+
const ntfy = new NtfyIntegration(String(this.context.configManager.get('surfaces.ntfy.baseUrl') || 'https://ntfy.sh'), await this.resolveNtfyToken() ?? undefined);
|
|
297
|
+
await ntfy.publish(topic, message, {
|
|
298
|
+
title,
|
|
299
|
+
markGoodVibesOrigin: true,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
async resolveNtfyToken() {
|
|
303
|
+
return await this.context.serviceRegistry.resolveSecret('ntfy', 'primary')
|
|
304
|
+
|| String(this.context.configManager.get('surfaces.ntfy.token') || '')
|
|
305
|
+
|| process.env.NTFY_ACCESS_TOKEN
|
|
306
|
+
|| null;
|
|
307
|
+
}
|
|
124
308
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface-delivery.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/surface-delivery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAK7G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAA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KxD,OAAO,CAAC,wBAAwB;IAmE1B,0BAA0B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAyChG,4BAA4B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBlG,yBAAyB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB/F,4BAA4B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CA0BzG"}
|
|
@@ -201,6 +201,7 @@ export class DaemonSurfaceDeliveryHelper {
|
|
|
201
201
|
],
|
|
202
202
|
}
|
|
203
203
|
: {}),
|
|
204
|
+
markGoodVibesOrigin: true,
|
|
204
205
|
});
|
|
205
206
|
}
|
|
206
207
|
async deliverWebhookAgentReply(pending, message) {
|
|
@@ -428,6 +429,7 @@ export class DaemonSurfaceDeliveryHelper {
|
|
|
428
429
|
await ntfy.publish(topic, `${isPending ? 'Approval required' : `Approval ${approval.status}`}: ${summary}`, {
|
|
429
430
|
title: approval.request.tool,
|
|
430
431
|
...(webUrl ? { click: webUrl } : {}),
|
|
432
|
+
markGoodVibesOrigin: true,
|
|
431
433
|
}).catch(() => { });
|
|
432
434
|
}
|
|
433
435
|
async deliverWebhookApprovalUpdate(approval, binding) {
|
|
@@ -7,7 +7,7 @@ export { Notifier } from './notifier.js';
|
|
|
7
7
|
export { GitHubIntegration } from './github.js';
|
|
8
8
|
export type { GitHubWebhookEvent } from './github.js';
|
|
9
9
|
export { DeliveryQueue, DeliveryError, classifyDeliveryError, snapshotQueueStatus } from './delivery.js';
|
|
10
|
-
export { NtfyIntegration } from './ntfy.js';
|
|
10
|
+
export { GOODVIBES_NTFY_ORIGIN, GOODVIBES_NTFY_ORIGIN_HEADER, GOODVIBES_NTFY_OUTBOUND_TAG, GOODVIBES_NTFY_AGENT_TOPIC, GOODVIBES_NTFY_CHAT_TOPIC, GOODVIBES_NTFY_DEFAULT_TOPICS, GOODVIBES_NTFY_REMOTE_TOPIC, NtfyIntegration, isGoodVibesNtfyDeliveryEcho, } from './ntfy.js';
|
|
11
11
|
export type { DeliveryOutcome, DeliveryFailureClass, DeadLetterEntry, DeliveryMetrics, DeliveryQueueConfig, IntegrationQueueStatus, } from './delivery.js';
|
|
12
12
|
export type { NtfyMessage, NtfyPublishOptions, NtfySubscribeOptions, NtfyWebSocketOptions } from './ntfy.js';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACrE,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,EAC5B,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACpH,YAAY,EACV,yBAAyB,EACzB,+BAA+B,EAC/B,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACrE,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,EAC5B,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACpH,YAAY,EACV,yBAAyB,EACzB,+BAA+B,EAC/B,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,eAAe,EACf,2BAA2B,GAC5B,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -4,4 +4,4 @@ export { DiscordInteractionType, DiscordInteractionResponseType } from './discor
|
|
|
4
4
|
export { Notifier } from './notifier.js';
|
|
5
5
|
export { GitHubIntegration } from './github.js';
|
|
6
6
|
export { DeliveryQueue, DeliveryError, classifyDeliveryError, snapshotQueueStatus } from './delivery.js';
|
|
7
|
-
export { NtfyIntegration } from './ntfy.js';
|
|
7
|
+
export { GOODVIBES_NTFY_ORIGIN, GOODVIBES_NTFY_ORIGIN_HEADER, GOODVIBES_NTFY_OUTBOUND_TAG, GOODVIBES_NTFY_AGENT_TOPIC, GOODVIBES_NTFY_CHAT_TOPIC, GOODVIBES_NTFY_DEFAULT_TOPICS, GOODVIBES_NTFY_REMOTE_TOPIC, NtfyIntegration, isGoodVibesNtfyDeliveryEcho, } from './ntfy.js';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export declare const GOODVIBES_NTFY_ORIGIN = "goodvibes-sdk";
|
|
2
|
+
export declare const GOODVIBES_NTFY_ORIGIN_HEADER = "X-Goodvibes-Origin";
|
|
3
|
+
export declare const GOODVIBES_NTFY_OUTBOUND_TAG = "goodvibes-sdk-outbound";
|
|
4
|
+
export declare const GOODVIBES_NTFY_CHAT_TOPIC = "goodvibes-chat";
|
|
5
|
+
export declare const GOODVIBES_NTFY_AGENT_TOPIC = "goodvibes-agent";
|
|
6
|
+
export declare const GOODVIBES_NTFY_REMOTE_TOPIC = "goodvibes-ntfy";
|
|
7
|
+
export declare const GOODVIBES_NTFY_DEFAULT_TOPICS: readonly ["goodvibes-chat", "goodvibes-agent", "goodvibes-ntfy"];
|
|
1
8
|
export interface NtfyPublishOptions {
|
|
2
9
|
readonly title?: string;
|
|
3
10
|
readonly priority?: 1 | 2 | 3 | 4 | 5;
|
|
@@ -5,6 +12,7 @@ export interface NtfyPublishOptions {
|
|
|
5
12
|
readonly click?: string;
|
|
6
13
|
readonly attach?: string;
|
|
7
14
|
readonly actions?: readonly string[];
|
|
15
|
+
readonly markGoodVibesOrigin?: boolean;
|
|
8
16
|
}
|
|
9
17
|
export interface NtfyMessage {
|
|
10
18
|
readonly id?: string;
|
|
@@ -25,6 +33,8 @@ export interface NtfySubscribeOptions {
|
|
|
25
33
|
readonly poll?: boolean;
|
|
26
34
|
readonly filters?: Record<string, string | number | boolean | readonly string[]>;
|
|
27
35
|
readonly signal?: AbortSignal;
|
|
36
|
+
readonly reconnect?: boolean;
|
|
37
|
+
readonly reconnectDelayMs?: number;
|
|
28
38
|
}
|
|
29
39
|
export interface NtfyWebSocketOptions extends NtfySubscribeOptions {
|
|
30
40
|
readonly WebSocketImpl?: typeof WebSocket;
|
|
@@ -40,4 +50,5 @@ export declare class NtfyIntegration {
|
|
|
40
50
|
connectWebSocket(topic: string, onMessage: (message: NtfyMessage) => void | Promise<void>, options?: NtfyWebSocketOptions): WebSocket;
|
|
41
51
|
private buildAuthHeaders;
|
|
42
52
|
}
|
|
53
|
+
export declare function isGoodVibesNtfyDeliveryEcho(message: Record<string, unknown>): boolean;
|
|
43
54
|
//# sourceMappingURL=ntfy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ntfy.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/integrations/ntfy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ntfy.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/integrations/ntfy.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AACrD,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AACjE,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AACpE,eAAO,MAAM,yBAAyB,mBAAmB,CAAC;AAC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