@pellux/goodvibes-sdk 0.23.2 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/contracts/zod-schemas/providers.d.ts +5 -5
- package/dist/_internal/platform/agents/orchestrator.d.ts +2 -0
- package/dist/_internal/platform/agents/orchestrator.d.ts.map +1 -1
- package/dist/_internal/platform/agents/orchestrator.js +38 -0
- package/dist/_internal/platform/automation/delivery-manager.d.ts +5 -0
- package/dist/_internal/platform/automation/delivery-manager.d.ts.map +1 -1
- package/dist/_internal/platform/automation/delivery-manager.js +14 -1
- package/dist/_internal/platform/automation/manager-runtime.d.ts +5 -0
- package/dist/_internal/platform/automation/manager-runtime.d.ts.map +1 -1
- package/dist/_internal/platform/automation/manager-runtime.js +32 -0
- package/dist/_internal/platform/channels/plugin-registry.d.ts +6 -0
- package/dist/_internal/platform/channels/plugin-registry.d.ts.map +1 -1
- package/dist/_internal/platform/channels/plugin-registry.js +17 -4
- package/dist/_internal/platform/channels/route-manager.d.ts +7 -0
- package/dist/_internal/platform/channels/route-manager.d.ts.map +1 -1
- package/dist/_internal/platform/channels/route-manager.js +41 -3
- package/dist/_internal/platform/channels/surface-registry.d.ts +3 -1
- package/dist/_internal/platform/channels/surface-registry.d.ts.map +1 -1
- package/dist/_internal/platform/channels/surface-registry.js +16 -17
- package/dist/_internal/platform/config/schema-types.d.ts +1 -1
- package/dist/_internal/platform/config/schema-types.d.ts.map +1 -1
- package/dist/_internal/platform/config/secret-refs.d.ts.map +1 -1
- package/dist/_internal/platform/config/secret-refs.js +137 -2
- package/dist/_internal/platform/control-plane/gateway.d.ts +5 -0
- package/dist/_internal/platform/control-plane/gateway.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/gateway.js +69 -4
- package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade-composition.js +2 -0
- package/dist/_internal/platform/daemon/facade.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade.js +3 -1
- package/dist/_internal/platform/daemon/service-manager.d.ts +5 -0
- package/dist/_internal/platform/daemon/service-manager.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/service-manager.js +29 -0
- package/dist/_internal/platform/integrations/delivery.d.ts +5 -1
- package/dist/_internal/platform/integrations/delivery.d.ts.map +1 -1
- package/dist/_internal/platform/integrations/delivery.js +8 -1
- package/dist/_internal/platform/integrations/notifier.d.ts +5 -1
- package/dist/_internal/platform/integrations/notifier.d.ts.map +1 -1
- package/dist/_internal/platform/integrations/notifier.js +6 -3
- package/dist/_internal/platform/permissions/manager.d.ts +3 -1
- package/dist/_internal/platform/permissions/manager.d.ts.map +1 -1
- package/dist/_internal/platform/permissions/manager.js +9 -5
- package/dist/_internal/platform/runtime/emitters/routes.d.ts +5 -0
- package/dist/_internal/platform/runtime/emitters/routes.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/emitters/routes.js +3 -0
- package/dist/_internal/platform/runtime/events/contracts/automation-route.d.ts +1 -0
- package/dist/_internal/platform/runtime/events/contracts/automation-route.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/events/contracts/automation-route.js +7 -0
- package/dist/_internal/platform/runtime/events/contracts.d.ts +1 -1
- package/dist/_internal/platform/runtime/events/contracts.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/events/contracts.js +3 -2
- package/dist/_internal/platform/runtime/events/routes.d.ts +5 -0
- package/dist/_internal/platform/runtime/events/routes.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/feature-flags/flags.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/feature-flags/flags.js +17 -21
- package/dist/_internal/platform/runtime/feature-flags/gates.d.ts +7 -0
- package/dist/_internal/platform/runtime/feature-flags/gates.d.ts.map +1 -0
- package/dist/_internal/platform/runtime/feature-flags/gates.js +38 -0
- package/dist/_internal/platform/runtime/feature-flags/index.d.ts +2 -0
- package/dist/_internal/platform/runtime/feature-flags/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/feature-flags/index.js +1 -0
- package/dist/_internal/platform/runtime/mcp/index.d.ts +2 -1
- package/dist/_internal/platform/runtime/mcp/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/mcp/index.js +4 -1
- package/dist/_internal/platform/runtime/permissions/index.d.ts +20 -1
- package/dist/_internal/platform/runtime/permissions/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/permissions/index.js +27 -1
- package/dist/_internal/platform/runtime/permissions/policy-loader.d.ts +6 -0
- package/dist/_internal/platform/runtime/permissions/policy-loader.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/permissions/policy-loader.js +7 -2
- package/dist/_internal/platform/runtime/plugins/index.d.ts +2 -1
- package/dist/_internal/platform/runtime/plugins/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/plugins/index.js +4 -1
- package/dist/_internal/platform/runtime/services.d.ts +1 -0
- package/dist/_internal/platform/runtime/services.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/services.js +21 -5
- package/dist/_internal/platform/runtime/shell-command-ops.d.ts +2 -0
- package/dist/_internal/platform/runtime/shell-command-ops.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/shell-command-ops.js +4 -1
- package/dist/_internal/platform/runtime/tasks/index.d.ts +2 -1
- package/dist/_internal/platform/runtime/tasks/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/tasks/index.js +2 -2
- package/dist/_internal/platform/runtime/tasks/manager.d.ts +5 -1
- package/dist/_internal/platform/runtime/tasks/manager.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/tasks/manager.js +30 -1
- package/dist/_internal/platform/runtime/telemetry/index.d.ts +9 -3
- package/dist/_internal/platform/runtime/telemetry/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/telemetry/index.js +7 -4
- package/dist/_internal/platform/runtime/tools/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/tools/index.js +4 -1
- package/dist/_internal/platform/runtime/tools/types.d.ts +6 -0
- package/dist/_internal/platform/runtime/tools/types.d.ts.map +1 -1
- package/dist/_internal/platform/security/token-audit.d.ts +7 -0
- package/dist/_internal/platform/security/token-audit.d.ts.map +1 -1
- package/dist/_internal/platform/security/token-audit.js +6 -2
- package/dist/_internal/platform/state/mode-manager.d.ts +7 -0
- package/dist/_internal/platform/state/mode-manager.d.ts.map +1 -1
- package/dist/_internal/platform/state/mode-manager.js +25 -0
- package/dist/_internal/platform/tools/index.d.ts +4 -0
- package/dist/_internal/platform/tools/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/index.js +37 -23
- package/dist/_internal/platform/tools/shared/overflow.d.ts +3 -0
- package/dist/_internal/platform/tools/shared/overflow.d.ts.map +1 -1
- package/dist/_internal/platform/tools/shared/overflow.js +6 -2
- package/dist/_internal/platform/version.js +1 -1
- package/dist/_internal/platform/watchers/registry.d.ts +6 -0
- package/dist/_internal/platform/watchers/registry.d.ts.map +1 -1
- package/dist/_internal/platform/watchers/registry.js +32 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
2
2
|
import { createDomainDispatch } from '../runtime/store/index.js';
|
|
3
3
|
import { emitControlPlaneAuthGranted, emitControlPlaneClientConnected, emitControlPlaneClientDisconnected, emitControlPlaneSubscriptionCreated, emitControlPlaneSubscriptionDropped, } from '../runtime/emitters/index.js';
|
|
4
4
|
import { renderControlPlaneGatewayWebUi } from './gateway-web-ui.js';
|
|
5
|
+
import { isFeatureGateEnabled, requireFeatureGate } from '../runtime/feature-flags/index.js';
|
|
5
6
|
const DEFAULT_DOMAINS = [
|
|
6
7
|
'session',
|
|
7
8
|
'tasks',
|
|
@@ -49,6 +50,7 @@ export class ControlPlaneGateway {
|
|
|
49
50
|
runtimeBus;
|
|
50
51
|
dispatch;
|
|
51
52
|
serverConfig;
|
|
53
|
+
featureFlags;
|
|
52
54
|
clients = new Map();
|
|
53
55
|
liveClients = new Map();
|
|
54
56
|
websocketClients = new Map();
|
|
@@ -85,19 +87,26 @@ export class ControlPlaneGateway {
|
|
|
85
87
|
this._recentEventsRing = new Array(this._recentEventsCapacity);
|
|
86
88
|
this.runtimeBus = config.runtimeBus ?? null;
|
|
87
89
|
this.dispatch = config.runtimeStore ? createDomainDispatch(config.runtimeStore) : null;
|
|
90
|
+
this.featureFlags = config.featureFlags ?? null;
|
|
88
91
|
this.serverConfig = {
|
|
89
92
|
...DEFAULT_SERVER_CONFIG,
|
|
90
93
|
...config.server,
|
|
91
94
|
};
|
|
92
95
|
if (this.dispatch) {
|
|
93
96
|
this.dispatch.syncControlPlaneState({
|
|
94
|
-
enabled: this.serverConfig.enabled,
|
|
97
|
+
enabled: this.isEnabled() && this.serverConfig.enabled,
|
|
95
98
|
host: this.serverConfig.host,
|
|
96
99
|
port: this.serverConfig.port,
|
|
97
|
-
connectionState: this.serverConfig.enabled ? 'disconnected' : 'disabled',
|
|
100
|
+
connectionState: this.isEnabled() && this.serverConfig.enabled ? 'disconnected' : 'disabled',
|
|
98
101
|
}, 'control-plane.gateway.init');
|
|
99
102
|
}
|
|
100
103
|
}
|
|
104
|
+
isEnabled() {
|
|
105
|
+
return isFeatureGateEnabled(this.featureFlags, 'control-plane-gateway', ['gateway-control-plane']);
|
|
106
|
+
}
|
|
107
|
+
requireEnabled(operation) {
|
|
108
|
+
requireFeatureGate(this.featureFlags, 'control-plane-gateway', operation, ['gateway-control-plane']);
|
|
109
|
+
}
|
|
101
110
|
attachRuntime(config) {
|
|
102
111
|
if (config.runtimeBus) {
|
|
103
112
|
this.runtimeBus = config.runtimeBus;
|
|
@@ -105,10 +114,10 @@ export class ControlPlaneGateway {
|
|
|
105
114
|
if (config.runtimeStore) {
|
|
106
115
|
this.dispatch = createDomainDispatch(config.runtimeStore);
|
|
107
116
|
this.dispatch.syncControlPlaneState({
|
|
108
|
-
enabled: this.serverConfig.enabled,
|
|
117
|
+
enabled: this.isEnabled() && this.serverConfig.enabled,
|
|
109
118
|
host: this.serverConfig.host,
|
|
110
119
|
port: this.serverConfig.port,
|
|
111
|
-
connectionState: this.serverConfig.enabled ? 'disconnected' : 'disabled',
|
|
120
|
+
connectionState: this.isEnabled() && this.serverConfig.enabled ? 'disconnected' : 'disabled',
|
|
112
121
|
}, 'control-plane.gateway.attach');
|
|
113
122
|
for (const client of this.clients.values()) {
|
|
114
123
|
this.dispatch.syncControlPlaneClient(client, 'control-plane.gateway.attach');
|
|
@@ -116,11 +125,31 @@ export class ControlPlaneGateway {
|
|
|
116
125
|
}
|
|
117
126
|
}
|
|
118
127
|
listClients() {
|
|
128
|
+
if (!this.isEnabled())
|
|
129
|
+
return [];
|
|
119
130
|
return [...this.clients.values()]
|
|
120
131
|
.sort((a, b) => (b.lastSeenAt ?? 0) - (a.lastSeenAt ?? 0) || a.id.localeCompare(b.id))
|
|
121
132
|
.map(toClientDescriptor);
|
|
122
133
|
}
|
|
123
134
|
getSnapshot() {
|
|
135
|
+
if (!this.isEnabled()) {
|
|
136
|
+
return {
|
|
137
|
+
server: { ...this.serverConfig, enabled: false },
|
|
138
|
+
disabled: true,
|
|
139
|
+
featureFlag: 'control-plane-gateway',
|
|
140
|
+
totals: {
|
|
141
|
+
clients: 0,
|
|
142
|
+
activeClients: 0,
|
|
143
|
+
surfaceMessages: 0,
|
|
144
|
+
recentEvents: 0,
|
|
145
|
+
requests: 0,
|
|
146
|
+
errors: 0,
|
|
147
|
+
},
|
|
148
|
+
clients: [],
|
|
149
|
+
messages: [],
|
|
150
|
+
recentEvents: [],
|
|
151
|
+
};
|
|
152
|
+
}
|
|
124
153
|
const active = [...this.clients.values()].filter((client) => client.connected);
|
|
125
154
|
return {
|
|
126
155
|
server: this.serverConfig,
|
|
@@ -138,12 +167,17 @@ export class ControlPlaneGateway {
|
|
|
138
167
|
};
|
|
139
168
|
}
|
|
140
169
|
listSurfaceMessages(limit = 50) {
|
|
170
|
+
if (!this.isEnabled())
|
|
171
|
+
return [];
|
|
141
172
|
return this.recentMessages.slice(0, Math.max(1, limit));
|
|
142
173
|
}
|
|
143
174
|
listRecentEvents(limit = 100) {
|
|
175
|
+
if (!this.isEnabled())
|
|
176
|
+
return [];
|
|
144
177
|
return this.recentEvents.slice(0, Math.max(1, limit));
|
|
145
178
|
}
|
|
146
179
|
publishSurfaceMessage(input) {
|
|
180
|
+
this.requireEnabled('publish surface message');
|
|
147
181
|
const message = {
|
|
148
182
|
id: `cpmsg-${randomUUID().slice(0, 8)}`,
|
|
149
183
|
createdAt: Date.now(),
|
|
@@ -168,6 +202,8 @@ export class ControlPlaneGateway {
|
|
|
168
202
|
return message;
|
|
169
203
|
}
|
|
170
204
|
publishEvent(event, payload, filter) {
|
|
205
|
+
if (!this.isEnabled())
|
|
206
|
+
return;
|
|
171
207
|
const record = this.rememberEvent(event, payload);
|
|
172
208
|
for (const client of this.liveClients.values()) {
|
|
173
209
|
if (filter?.clientKind && client.kind !== filter.clientKind)
|
|
@@ -182,6 +218,8 @@ export class ControlPlaneGateway {
|
|
|
182
218
|
}
|
|
183
219
|
}
|
|
184
220
|
recordApiRequest(input) {
|
|
221
|
+
if (!this.isEnabled())
|
|
222
|
+
return;
|
|
185
223
|
this.requestCount += 1;
|
|
186
224
|
this.lastRequestAt = Date.now();
|
|
187
225
|
if (input.status >= 400 || input.error) {
|
|
@@ -202,6 +240,16 @@ export class ControlPlaneGateway {
|
|
|
202
240
|
});
|
|
203
241
|
}
|
|
204
242
|
setServerState(patch) {
|
|
243
|
+
if (!this.isEnabled()) {
|
|
244
|
+
Object.assign(this.serverConfig, { ...patch, enabled: false });
|
|
245
|
+
this.dispatch?.syncControlPlaneState({
|
|
246
|
+
enabled: false,
|
|
247
|
+
host: this.serverConfig.host,
|
|
248
|
+
port: this.serverConfig.port,
|
|
249
|
+
connectionState: 'disabled',
|
|
250
|
+
}, 'control-plane.gateway.state.disabled');
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
205
253
|
Object.assign(this.serverConfig, patch);
|
|
206
254
|
const hasActiveClient = [...this.clients.values()].some((client) => client.connected);
|
|
207
255
|
this.dispatch?.syncControlPlaneState({
|
|
@@ -215,6 +263,7 @@ export class ControlPlaneGateway {
|
|
|
215
263
|
}, 'control-plane.gateway.state');
|
|
216
264
|
}
|
|
217
265
|
openWebSocketClient(options, send) {
|
|
266
|
+
this.requireEnabled('open websocket client');
|
|
218
267
|
if (!this.runtimeBus) {
|
|
219
268
|
throw new Error('Runtime event bus unavailable');
|
|
220
269
|
}
|
|
@@ -299,6 +348,8 @@ export class ControlPlaneGateway {
|
|
|
299
348
|
return { clientId, domains: selectedDomains };
|
|
300
349
|
}
|
|
301
350
|
touchWebSocketClient(clientId, metadata = {}) {
|
|
351
|
+
if (!this.isEnabled())
|
|
352
|
+
return;
|
|
302
353
|
const existing = this.clients.get(clientId);
|
|
303
354
|
if (!existing)
|
|
304
355
|
return;
|
|
@@ -314,6 +365,8 @@ export class ControlPlaneGateway {
|
|
|
314
365
|
this.dispatch?.syncControlPlaneClient(updated, 'control-plane.gateway.ws-touch');
|
|
315
366
|
}
|
|
316
367
|
authenticateClient(clientId, input) {
|
|
368
|
+
if (!this.isEnabled())
|
|
369
|
+
return;
|
|
317
370
|
const existing = this.clients.get(clientId);
|
|
318
371
|
if (!existing || !this.runtimeBus)
|
|
319
372
|
return;
|
|
@@ -342,6 +395,8 @@ export class ControlPlaneGateway {
|
|
|
342
395
|
});
|
|
343
396
|
}
|
|
344
397
|
subscribeWebSocketClient(clientId, domains) {
|
|
398
|
+
if (!this.isEnabled())
|
|
399
|
+
return;
|
|
345
400
|
const wsClient = this.websocketClients.get(clientId);
|
|
346
401
|
if (!wsClient || !this.runtimeBus)
|
|
347
402
|
return;
|
|
@@ -364,6 +419,8 @@ export class ControlPlaneGateway {
|
|
|
364
419
|
this.touchWebSocketClient(clientId, { domains: [...wsClient.domains] });
|
|
365
420
|
}
|
|
366
421
|
unsubscribeWebSocketClient(clientId, domains) {
|
|
422
|
+
if (!this.isEnabled())
|
|
423
|
+
return;
|
|
367
424
|
const wsClient = this.websocketClients.get(clientId);
|
|
368
425
|
if (!wsClient)
|
|
369
426
|
return;
|
|
@@ -377,6 +434,8 @@ export class ControlPlaneGateway {
|
|
|
377
434
|
this.touchWebSocketClient(clientId, { domains: [...wsClient.domains] });
|
|
378
435
|
}
|
|
379
436
|
closeWebSocketClient(clientId, reason = 'socket-closed') {
|
|
437
|
+
if (!this.isEnabled())
|
|
438
|
+
return;
|
|
380
439
|
const wsClient = this.websocketClients.get(clientId);
|
|
381
440
|
if (!wsClient)
|
|
382
441
|
return;
|
|
@@ -428,6 +487,9 @@ export class ControlPlaneGateway {
|
|
|
428
487
|
}
|
|
429
488
|
}
|
|
430
489
|
createEventStream(request, options = {}) {
|
|
490
|
+
if (!this.isEnabled()) {
|
|
491
|
+
return Response.json({ error: 'control-plane-gateway feature flag is disabled' }, { status: 503 });
|
|
492
|
+
}
|
|
431
493
|
if (!this.runtimeBus) {
|
|
432
494
|
return Response.json({ error: 'Runtime event bus unavailable' }, { status: 503 });
|
|
433
495
|
}
|
|
@@ -596,6 +658,9 @@ export class ControlPlaneGateway {
|
|
|
596
658
|
});
|
|
597
659
|
}
|
|
598
660
|
renderWebUi(authTokenHint = '') {
|
|
661
|
+
if (!this.isEnabled()) {
|
|
662
|
+
return Response.json({ error: 'control-plane-gateway feature flag is disabled' }, { status: 503 });
|
|
663
|
+
}
|
|
599
664
|
return renderControlPlaneGatewayWebUi(authTokenHint);
|
|
600
665
|
}
|
|
601
666
|
_scheduleControlPlaneSync() {
|
|
@@ -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,
|
|
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,CA0J3B;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;IAChF,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,yBAAyB,EAAE,WAAW,GAAG,QAAQ,CAAC;IACzK,QAAQ,CAAC,4BAA4B,EAAE,CAAC,OAAO,EAAE,OAAO,kDAAkD,EAAE,sBAAsB,GAAG,SAAS,EAAE,KAAK,EAAE;QACrJ,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAC7B,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAoBP"}
|
|
@@ -160,6 +160,7 @@ export function resolveDaemonFacadeRuntime(config, fallbackConfigManager) {
|
|
|
160
160
|
const controlPlaneGateway = new ControlPlaneGateway({
|
|
161
161
|
runtimeBus,
|
|
162
162
|
runtimeStore,
|
|
163
|
+
featureFlags: runtimeServices.featureFlags,
|
|
163
164
|
server: {
|
|
164
165
|
enabled: false,
|
|
165
166
|
...resolveHostBinding(resolvedConfigManager.get('controlPlane.hostMode') ?? 'local', String(resolvedConfigManager.get('controlPlane.host') ?? '127.0.0.1'), Number(resolvedConfigManager.get('controlPlane.port') ?? 3421), 'controlPlane'),
|
|
@@ -236,6 +237,7 @@ export function resolveDaemonFacadeRuntime(config, fallbackConfigManager) {
|
|
|
236
237
|
binaryBaseName: 'goodvibes',
|
|
237
238
|
defaultServiceName: 'goodvibes',
|
|
238
239
|
defaultServiceDescription: 'goodvibes omnichannel daemon host',
|
|
240
|
+
featureFlags: runtimeServices.featureFlags,
|
|
239
241
|
}),
|
|
240
242
|
distributedRuntime: runtimeServices.distributedRuntime,
|
|
241
243
|
voiceService: runtimeServices.voiceService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/facade.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/facade.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAmD1D,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAuB,MAAM,YAAY,CAAC;AAexF;;;;;;;;GAQG;AACH,qBAAa,YAAY;IA6DX,OAAO,CAAC,MAAM;IA5D1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAA6C;IAC3D,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,mBAAmB,CAAgB;IAC3C,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkC;IAC/D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqC;IACrE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAsB;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,QAAQ,CAA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1B,+BAA+B;YAe/B,uBAAuB;YAoBvB,aAAa;YAIb,iBAAiB;YAIjB,aAAa;YAIb,qBAAqB;IAInC,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,iBAAiB;YAuBX,oBAAoB;IAgClC,OAAO,CAAC,aAAa;IAyCrB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,sBAAsB;YAIhB,yBAAyB;IAGvC,OAAO,CAAC,iBAAiB;IAGzB,OAAO,CAAC,kBAAkB;CAG3B"}
|
|
@@ -8,6 +8,7 @@ import { AgentTaskAdapter } from '../runtime/tasks/adapters/agent-adapter.js';
|
|
|
8
8
|
import { configureDaemonSessionContinuation, createDaemonFacadeCollaborators, resolveDaemonFacadeRuntime, } from './facade-composition.js';
|
|
9
9
|
import { GlobalNetworkTransportInstaller, resolveInboundTlsContext, } from '../runtime/network/index.js';
|
|
10
10
|
import { createRuntimeServices } from '../runtime/services.js';
|
|
11
|
+
import { isSurfaceFeatureGateEnabled } from '../runtime/feature-flags/index.js';
|
|
11
12
|
import { readAutomationReasoningEffort, readAutomationWakeMode, readExternalContentSource, readStringList, } from './helpers.js';
|
|
12
13
|
import { requirePortAvailable } from './port-check.js';
|
|
13
14
|
import { resolveHostBinding } from './host-resolver.js';
|
|
@@ -623,7 +624,8 @@ export class DaemonServer {
|
|
|
623
624
|
}, 'daemon.server.agent-finish');
|
|
624
625
|
}
|
|
625
626
|
surfaceDeliveryEnabled(surface) {
|
|
626
|
-
return
|
|
627
|
+
return isSurfaceFeatureGateEnabled(this.runtimeServices.featureFlags, surface)
|
|
628
|
+
&& isSurfaceDeliveryEnabled(this.configManager, surface);
|
|
627
629
|
}
|
|
628
630
|
async pollPendingSurfaceReplies() {
|
|
629
631
|
await this.surfaceDeliveryHelper.pollPendingSurfaceReplies((record) => this.syncFinishedAgentTask(record));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConfigManager } from '../config/manager.js';
|
|
2
|
+
import type { FeatureFlagReader } from '../runtime/feature-flags/index.js';
|
|
2
3
|
export type ManagedServicePlatform = 'systemd' | 'launchd' | 'windows' | 'manual';
|
|
3
4
|
export interface ManagedServiceDefinition {
|
|
4
5
|
readonly name: string;
|
|
@@ -39,6 +40,7 @@ export interface ManagedServiceManagerOptions extends ManagedServicePaths {
|
|
|
39
40
|
readonly binaryBaseName?: string;
|
|
40
41
|
readonly defaultServiceName?: string;
|
|
41
42
|
readonly defaultServiceDescription?: string;
|
|
43
|
+
readonly featureFlags?: FeatureFlagReader;
|
|
42
44
|
}
|
|
43
45
|
export declare class PlatformServiceManager {
|
|
44
46
|
private readonly configManager;
|
|
@@ -50,7 +52,10 @@ export declare class PlatformServiceManager {
|
|
|
50
52
|
private readonly binaryBaseName?;
|
|
51
53
|
private readonly defaultServiceName?;
|
|
52
54
|
private readonly defaultServiceDescription?;
|
|
55
|
+
private readonly featureFlags;
|
|
53
56
|
constructor(configManager: ConfigManager, options: ManagedServiceManagerOptions);
|
|
57
|
+
private isEnabled;
|
|
58
|
+
private requireEnabled;
|
|
54
59
|
private getPaths;
|
|
55
60
|
status(): ManagedServiceStatus;
|
|
56
61
|
install(): ManagedServiceStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-manager.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/service-manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"service-manager.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/service-manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAElF,MAAM,WAAW,wBAAwB;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Q;IAOhB,MAAM,IAAI,oBAAoB;IA0C9B,OAAO,IAAI,oBAAoB;IAqB/B,SAAS,IAAI,oBAAoB;IAgBjC,KAAK,IAAI,oBAAoB;IAS7B,IAAI,IAAI,oBAAoB;IAS5B,OAAO,IAAI,oBAAoB;IAU/B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,WAAW;IAiCnB,OAAO,CAAC,UAAU;IAmBlB,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,YAAY;CAQrB"}
|
|
@@ -3,6 +3,7 @@ import { dirname, join, resolve } from 'node:path';
|
|
|
3
3
|
import { spawnSync, spawn } from 'node:child_process';
|
|
4
4
|
import { ConfigManager } from '../config/manager.js';
|
|
5
5
|
import { resolveScopedDirectory } from '../runtime/surface-root.js';
|
|
6
|
+
import { isFeatureGateEnabled, requireFeatureGate } from '../runtime/feature-flags/index.js';
|
|
6
7
|
function detectPlatform(platform) {
|
|
7
8
|
switch (platform) {
|
|
8
9
|
case 'systemd':
|
|
@@ -166,6 +167,7 @@ export class PlatformServiceManager {
|
|
|
166
167
|
binaryBaseName;
|
|
167
168
|
defaultServiceName;
|
|
168
169
|
defaultServiceDescription;
|
|
170
|
+
featureFlags;
|
|
169
171
|
constructor(configManager, options) {
|
|
170
172
|
this.configManager = configManager;
|
|
171
173
|
this.workingDirectory = resolve(options.workingDirectory);
|
|
@@ -176,6 +178,13 @@ export class PlatformServiceManager {
|
|
|
176
178
|
this.binaryBaseName = options.binaryBaseName;
|
|
177
179
|
this.defaultServiceName = options.defaultServiceName;
|
|
178
180
|
this.defaultServiceDescription = options.defaultServiceDescription;
|
|
181
|
+
this.featureFlags = options.featureFlags ?? null;
|
|
182
|
+
}
|
|
183
|
+
isEnabled() {
|
|
184
|
+
return isFeatureGateEnabled(this.featureFlags, 'service-management', ['service-installation']);
|
|
185
|
+
}
|
|
186
|
+
requireEnabled(operation) {
|
|
187
|
+
requireFeatureGate(this.featureFlags, 'service-management', operation, ['service-installation']);
|
|
179
188
|
}
|
|
180
189
|
getPaths() {
|
|
181
190
|
return {
|
|
@@ -187,6 +196,21 @@ export class PlatformServiceManager {
|
|
|
187
196
|
const platform = detectPlatform(String(this.configManager.get('service.platform')));
|
|
188
197
|
const serviceName = resolveServiceName(this.configManager, this.defaultServiceName);
|
|
189
198
|
const path = definitionPath(platform, serviceName, this.getPaths(), this.surfaceRoot);
|
|
199
|
+
if (!this.isEnabled()) {
|
|
200
|
+
const definition = this.resolveDefinition();
|
|
201
|
+
return {
|
|
202
|
+
platform,
|
|
203
|
+
path,
|
|
204
|
+
installed: false,
|
|
205
|
+
autostart: false,
|
|
206
|
+
running: false,
|
|
207
|
+
logPath: resolveLogPath(this.configManager, platform, this.workingDirectory, this.surfaceRoot),
|
|
208
|
+
commandPreview: [definition.command, ...definition.args].join(' '),
|
|
209
|
+
suggestedCommands: [],
|
|
210
|
+
lastAction: 'status',
|
|
211
|
+
actionError: 'service-management feature flag is disabled',
|
|
212
|
+
};
|
|
213
|
+
}
|
|
190
214
|
const installed = existsSync(path);
|
|
191
215
|
const pidPath = pidFilePath(platform, this.workingDirectory, this.surfaceRoot);
|
|
192
216
|
const pid = existsSync(pidPath) ? this.readPid(pidPath) : undefined;
|
|
@@ -210,6 +234,7 @@ export class PlatformServiceManager {
|
|
|
210
234
|
};
|
|
211
235
|
}
|
|
212
236
|
install() {
|
|
237
|
+
this.requireEnabled('install service');
|
|
213
238
|
const platform = detectPlatform(String(this.configManager.get('service.platform')));
|
|
214
239
|
const serviceName = resolveServiceName(this.configManager, this.defaultServiceName);
|
|
215
240
|
const definition = this.resolveDefinition();
|
|
@@ -229,6 +254,7 @@ export class PlatformServiceManager {
|
|
|
229
254
|
};
|
|
230
255
|
}
|
|
231
256
|
uninstall() {
|
|
257
|
+
this.requireEnabled('uninstall service');
|
|
232
258
|
const status = this.status();
|
|
233
259
|
if (existsSync(status.path)) {
|
|
234
260
|
rmSync(status.path, { force: true });
|
|
@@ -243,6 +269,7 @@ export class PlatformServiceManager {
|
|
|
243
269
|
};
|
|
244
270
|
}
|
|
245
271
|
start() {
|
|
272
|
+
this.requireEnabled('start service');
|
|
246
273
|
const platform = detectPlatform(String(this.configManager.get('service.platform')));
|
|
247
274
|
if (platform === 'manual') {
|
|
248
275
|
return this.startManual(platform);
|
|
@@ -250,6 +277,7 @@ export class PlatformServiceManager {
|
|
|
250
277
|
return this.runPlatformAction(platform, 'start');
|
|
251
278
|
}
|
|
252
279
|
stop() {
|
|
280
|
+
this.requireEnabled('stop service');
|
|
253
281
|
const platform = detectPlatform(String(this.configManager.get('service.platform')));
|
|
254
282
|
if (platform === 'manual') {
|
|
255
283
|
return this.stopManual(platform);
|
|
@@ -257,6 +285,7 @@ export class PlatformServiceManager {
|
|
|
257
285
|
return this.runPlatformAction(platform, 'stop');
|
|
258
286
|
}
|
|
259
287
|
restart() {
|
|
288
|
+
this.requireEnabled('restart service');
|
|
260
289
|
const platform = detectPlatform(String(this.configManager.get('service.platform')));
|
|
261
290
|
if (platform === 'manual') {
|
|
262
291
|
this.stopManual(platform);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GoodVibesSdkError } from '../../errors/index.js';
|
|
2
|
+
import type { FeatureFlagManager } from '../runtime/feature-flags/index.js';
|
|
2
3
|
/**
|
|
3
4
|
* The three possible outcomes for a single integration delivery attempt.
|
|
4
5
|
*
|
|
@@ -92,6 +93,9 @@ export interface DeliveryQueueConfig {
|
|
|
92
93
|
*/
|
|
93
94
|
sloEnforced: boolean;
|
|
94
95
|
}
|
|
96
|
+
export interface DeliveryQueueOptions extends Partial<DeliveryQueueConfig> {
|
|
97
|
+
readonly featureFlags?: Pick<FeatureFlagManager, 'isEnabled'> | null;
|
|
98
|
+
}
|
|
95
99
|
/**
|
|
96
100
|
* Delivery queue with retry/backoff and dead-letter storage.
|
|
97
101
|
*
|
|
@@ -117,7 +121,7 @@ export declare class DeliveryQueue {
|
|
|
117
121
|
private _delivered;
|
|
118
122
|
private _retrying;
|
|
119
123
|
private _deadLettered;
|
|
120
|
-
constructor(config?:
|
|
124
|
+
constructor(config?: DeliveryQueueOptions);
|
|
121
125
|
/**
|
|
122
126
|
* Enqueue a delivery attempt.
|
|
123
127
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/integrations/delivery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"delivery.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/integrations/delivery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAQ5E;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,UAAU,CAAC;AAS5D;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CA6B1E;AAMD,4EAA4E;AAC5E,qBAAa,aAAc,SAAQ,iBAAiB;aAIhC,YAAY,EAAE,oBAAoB;aAClC,UAAU,CAAC,EAAE,MAAM;IAJrC,SAAiB,IAAI,EAAE,gBAAgB,CAAC;gBAEtC,OAAO,EAAE,MAAM,EACC,YAAY,EAAE,oBAAoB,EAClC,UAAU,CAAC,EAAE,MAAM,YAAA;CAKtC;AAMD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,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IACzB,gCAAgC;IAChC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,yEAAyE;IACzE,QAAQ,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;IAChD,yCAAyC;IACzC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,iCAAiC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,OAAO,GACnB,sBAAsB,CASxB"}
|
|
@@ -94,7 +94,14 @@ export class DeliveryQueue {
|
|
|
94
94
|
_retrying = 0;
|
|
95
95
|
_deadLettered = 0;
|
|
96
96
|
constructor(config = {}) {
|
|
97
|
-
|
|
97
|
+
const { featureFlags, ...queueConfig } = config;
|
|
98
|
+
this._config = {
|
|
99
|
+
...DEFAULT_CONFIG,
|
|
100
|
+
...queueConfig,
|
|
101
|
+
sloEnforced: queueConfig.sloEnforced
|
|
102
|
+
?? featureFlags?.isEnabled('integration-delivery-slo')
|
|
103
|
+
?? DEFAULT_CONFIG.sloEnforced,
|
|
104
|
+
};
|
|
98
105
|
}
|
|
99
106
|
// -------------------------------------------------------------------------
|
|
100
107
|
// Public API
|
|
@@ -3,6 +3,7 @@ import { SlackIntegration } from './slack.js';
|
|
|
3
3
|
import { DiscordIntegration } from './discord.js';
|
|
4
4
|
import type { DeliveryQueueConfig, IntegrationQueueStatus } from './delivery.js';
|
|
5
5
|
import { ServiceRegistry } from '../config/service-registry.js';
|
|
6
|
+
import type { FeatureFlagManager } from '../runtime/feature-flags/index.js';
|
|
6
7
|
/**
|
|
7
8
|
* Notifier — unified notification dispatcher.
|
|
8
9
|
*
|
|
@@ -21,11 +22,14 @@ export declare class Notifier {
|
|
|
21
22
|
slack?: SlackIntegration;
|
|
22
23
|
discord?: DiscordIntegration;
|
|
23
24
|
delivery?: Partial<DeliveryQueueConfig>;
|
|
25
|
+
featureFlags?: Pick<FeatureFlagManager, 'isEnabled'> | null;
|
|
24
26
|
});
|
|
25
27
|
/**
|
|
26
28
|
* Create a Notifier pre-wired from configured services and environment variables.
|
|
27
29
|
*/
|
|
28
|
-
static fromConfig(serviceRegistry: Pick<ServiceRegistry, 'resolveSecret'
|
|
30
|
+
static fromConfig(serviceRegistry: Pick<ServiceRegistry, 'resolveSecret'>, options?: {
|
|
31
|
+
featureFlags?: Pick<FeatureFlagManager, 'isEnabled'> | null;
|
|
32
|
+
}): Promise<Notifier>;
|
|
29
33
|
/**
|
|
30
34
|
* Send a notification to all configured channels.
|
|
31
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifier.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/integrations/notifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"notifier.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/integrations/notifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC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|
|
25
25
|
this.slack = options?.slack;
|
|
26
26
|
this.discord = options?.discord;
|
|
27
|
-
this._queue = new DeliveryQueue(
|
|
27
|
+
this._queue = new DeliveryQueue({
|
|
28
|
+
...(options?.delivery ?? {}),
|
|
29
|
+
featureFlags: options?.featureFlags,
|
|
30
|
+
});
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
30
33
|
* Create a Notifier pre-wired from configured services and environment variables.
|
|
31
34
|
*/
|
|
32
|
-
static async fromConfig(serviceRegistry) {
|
|
35
|
+
static async fromConfig(serviceRegistry, options = {}) {
|
|
33
36
|
const [slackWebhookFromService, slackTokenFromService, discordWebhookFromService, discordTokenFromService,] = await Promise.all([
|
|
34
37
|
serviceRegistry.resolveSecret('slack', 'webhookUrl'),
|
|
35
38
|
serviceRegistry.resolveSecret('slack', 'primary'),
|
|
@@ -46,7 +49,7 @@ export class Notifier {
|
|
|
46
49
|
const discord = discordWebhook || discordToken
|
|
47
50
|
? new DiscordIntegration(discordWebhook, discordToken)
|
|
48
51
|
: undefined;
|
|
49
|
-
return new Notifier({ slack, discord });
|
|
52
|
+
return new Notifier({ slack, discord, featureFlags: options.featureFlags });
|
|
50
53
|
}
|
|
51
54
|
// -------------------------------------------------------------------------
|
|
52
55
|
// Public API
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getConfigSnapshot } from '../config/index.js';
|
|
2
2
|
import type { PermissionRequestHandler } from './prompt.js';
|
|
3
3
|
import type { PolicyRuntimeState } from '../runtime/permissions/policy-runtime.js';
|
|
4
|
+
import type { FeatureFlagManager } from '../runtime/feature-flags/index.js';
|
|
4
5
|
import type { HookDispatcher } from '../hooks/index.js';
|
|
5
6
|
import type { ConfigManager } from '../config/manager.js';
|
|
6
7
|
import type { PermissionCategory, PermissionCheckResult } from './types.js';
|
|
@@ -29,7 +30,8 @@ export declare class PermissionManager {
|
|
|
29
30
|
private readonly configReader;
|
|
30
31
|
private readonly hookDispatcher;
|
|
31
32
|
private readonly policyRuntimeState;
|
|
32
|
-
|
|
33
|
+
private readonly featureFlags;
|
|
34
|
+
constructor(requestPermission: PermissionRequestHandler | undefined, configReader: PermissionConfigReader, policyRuntimeState: Pick<PolicyRuntimeState, 'recordPermissionRequest' | 'recordPermissionDecision' | 'getRegistry'>, hookDispatcher?: Pick<HookDispatcher, 'fire'> | null, featureFlags?: Pick<FeatureFlagManager, 'isEnabled'> | null);
|
|
33
35
|
/**
|
|
34
36
|
* check - Returns a Promise that resolves to true (approved) or false (denied).
|
|
35
37
|
* Blocks orchestrator until the user responds when a prompt is needed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/permissions/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAGnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EAGtB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAEpB,KAAK,wBAAwB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE,MAAM,WAAW,sBAAsB;IACrC,oBAAoB,IAAI,OAAO,CAAC;IAChC,WAAW,IAAI,wBAAwB,CAAC;IACxC,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,wBAAgB,4BAA4B,CAC1C,aA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AC,oBAAoB;IAiC5B,OAAO,CAAC,aAAa;YA0BP,QAAQ;CAsBvB"}
|
|
@@ -62,11 +62,13 @@ export class PermissionManager {
|
|
|
62
62
|
configReader;
|
|
63
63
|
hookDispatcher;
|
|
64
64
|
policyRuntimeState;
|
|
65
|
-
|
|
65
|
+
featureFlags;
|
|
66
|
+
constructor(requestPermission = async () => ({ approved: false, remember: false }), configReader, policyRuntimeState, hookDispatcher = null, featureFlags = null) {
|
|
66
67
|
this.requestPermission = requestPermission;
|
|
67
68
|
this.configReader = configReader;
|
|
68
69
|
this.policyRuntimeState = policyRuntimeState;
|
|
69
70
|
this.hookDispatcher = hookDispatcher;
|
|
71
|
+
this.featureFlags = featureFlags;
|
|
70
72
|
}
|
|
71
73
|
/**
|
|
72
74
|
* check - Returns a Promise that resolves to true (approved) or false (denied).
|
|
@@ -102,10 +104,12 @@ export class PermissionManager {
|
|
|
102
104
|
if (mode === 'allow-all') {
|
|
103
105
|
return this.emitAndReturn(callId, toolName, category, this.result(true, false, 'runtime_mode', 'mode_allow_all', analysis));
|
|
104
106
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
if (this.featureFlags?.isEnabled('permissions-policy-engine') === true) {
|
|
108
|
+
const evaluatorDecision = this.evaluateRuntimePolicy(toolName, args, mode);
|
|
109
|
+
const mappedDecision = this.mapEvaluatorDecision(evaluatorDecision, analysis);
|
|
110
|
+
if (mappedDecision) {
|
|
111
|
+
return this.emitAndReturn(callId, toolName, category, mappedDecision);
|
|
112
|
+
}
|
|
109
113
|
}
|
|
110
114
|
// 3. custom mode: check per-tool setting
|
|
111
115
|
if (mode === 'custom') {
|
|
@@ -15,6 +15,11 @@ export declare function emitRouteBindingUpdated(bus: RuntimeEventBus, ctx: Emitt
|
|
|
15
15
|
bindingId: string;
|
|
16
16
|
changedFields: string[];
|
|
17
17
|
}): void;
|
|
18
|
+
export declare function emitRouteBindingRemoved(bus: RuntimeEventBus, ctx: EmitterContext, data: {
|
|
19
|
+
bindingId: string;
|
|
20
|
+
surfaceKind: RouteSurfaceKind;
|
|
21
|
+
externalId: string;
|
|
22
|
+
}): void;
|
|
18
23
|
export declare function emitRouteBindingResolved(bus: RuntimeEventBus, ctx: EmitterContext, data: {
|
|
19
24
|
bindingId: string;
|
|
20
25
|
surfaceKind: RouteSurfaceKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/runtime/emitters/routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAc,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAUjD,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC5H,IAAI,CAEN;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,GACnD,IAAI,CAEN;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;C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,CAEN;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC7E,IAAI,CAEN;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC5H,IAAI,CAEN;AAED,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtH,IAAI,CAEN;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,WAAW,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACzE,IAAI,CAEN"}
|
|
@@ -11,6 +11,9 @@ export function emitRouteBindingCreated(bus, ctx, data) {
|
|
|
11
11
|
export function emitRouteBindingUpdated(bus, ctx, data) {
|
|
12
12
|
bus.emit('routes', routeEvent('ROUTE_BINDING_UPDATED', data, ctx));
|
|
13
13
|
}
|
|
14
|
+
export function emitRouteBindingRemoved(bus, ctx, data) {
|
|
15
|
+
bus.emit('routes', routeEvent('ROUTE_BINDING_REMOVED', data, ctx));
|
|
16
|
+
}
|
|
14
17
|
export function emitRouteBindingResolved(bus, ctx, data) {
|
|
15
18
|
bus.emit('routes', routeEvent('ROUTE_BINDING_RESOLVED', data, ctx));
|
|
16
19
|
}
|
|
@@ -14,6 +14,7 @@ export declare function validateAutomationScheduleError(v: unknown): ContractRes
|
|
|
14
14
|
export declare function validateAutomationJobAutoDisabled(v: unknown): ContractResult;
|
|
15
15
|
export declare function validateRouteBindingCreated(v: unknown): ContractResult;
|
|
16
16
|
export declare function validateRouteBindingUpdated(v: unknown): ContractResult;
|
|
17
|
+
export declare function validateRouteBindingRemoved(v: unknown): ContractResult;
|
|
17
18
|
export declare function validateRouteBindingResolved(v: unknown): ContractResult;
|
|
18
19
|
export declare function validateRouteReplyTargetCaptured(v: unknown): ContractResult;
|
|
19
20
|
export declare function validateRouteBindingFailed(v: unknown): ContractResult;
|