@pellux/goodvibes-sdk 0.24.0 → 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/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/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 { mkdirSync, writeFileSync, readFileSync, readdirSync, unlinkSync, statSy
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { logger } from '../../utils/logger.js';
|
|
4
4
|
import { summarizeError } from '../../utils/error-display.js';
|
|
5
|
+
import { isFeatureGateEnabled } from '../../runtime/feature-flags/index.js';
|
|
5
6
|
// ─── Constants ─────────────────────────────────────────────────────────────
|
|
6
7
|
export const DEFAULT_MAX_CHARS = 50_000;
|
|
7
8
|
const OVERFLOW_DIR = '.goodvibes/.overflow';
|
|
@@ -277,10 +278,13 @@ export class OverflowHandler {
|
|
|
277
278
|
backend;
|
|
278
279
|
retention;
|
|
279
280
|
constructor(config = {}) {
|
|
280
|
-
|
|
281
|
+
const alternateBackendsEnabled = isFeatureGateEnabled(config.featureFlags, 'overflow-spill-backends');
|
|
282
|
+
const backend = alternateBackendsEnabled ? config.backend : undefined;
|
|
283
|
+
const spillBackend = alternateBackendsEnabled ? (config.spillBackend ?? 'file') : 'file';
|
|
284
|
+
if (!backend && spillBackend === 'file' && !config.baseDir) {
|
|
281
285
|
throw new Error('OverflowHandler requires an explicit baseDir when using the file spill backend');
|
|
282
286
|
}
|
|
283
|
-
this.backend =
|
|
287
|
+
this.backend = backend ?? createSpillBackend(spillBackend, config.baseDir);
|
|
284
288
|
this.retention = { ...DEFAULT_RETENTION, ...config.retention };
|
|
285
289
|
}
|
|
286
290
|
sanitizeLabel(label) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
let version = '0.
|
|
3
|
+
let version = '0.25.0';
|
|
4
4
|
try {
|
|
5
5
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
|
|
6
6
|
version = pkg.version ?? version;
|
|
@@ -2,6 +2,7 @@ import type { RuntimeStore } from '../runtime/store/index.js';
|
|
|
2
2
|
import type { RuntimeEventBus } from '../runtime/events/index.js';
|
|
3
3
|
import type { WatcherKind, WatcherRecord } from '../runtime/store/domains/watchers.js';
|
|
4
4
|
import type { AutomationSourceRecord } from '../automation/sources.js';
|
|
5
|
+
import type { FeatureFlagReader } from '../runtime/feature-flags/index.js';
|
|
5
6
|
export interface RegisterWatcherInput {
|
|
6
7
|
readonly id: string;
|
|
7
8
|
readonly label: string;
|
|
@@ -20,6 +21,7 @@ export interface RegisterPollingWatcherInput {
|
|
|
20
21
|
}
|
|
21
22
|
export interface WatcherRegistryOptions {
|
|
22
23
|
readonly storePath?: string;
|
|
24
|
+
readonly featureFlags?: FeatureFlagReader;
|
|
23
25
|
}
|
|
24
26
|
export declare class WatcherRegistry {
|
|
25
27
|
private readonly watchers;
|
|
@@ -28,8 +30,12 @@ export declare class WatcherRegistry {
|
|
|
28
30
|
private readonly storePath;
|
|
29
31
|
private runtimeDispatch;
|
|
30
32
|
private runtimeBus;
|
|
33
|
+
private readonly featureFlags;
|
|
31
34
|
private loaded;
|
|
32
35
|
constructor(options?: WatcherRegistryOptions);
|
|
36
|
+
private isEnabled;
|
|
37
|
+
private requireEnabled;
|
|
38
|
+
private clearTimers;
|
|
33
39
|
attachRuntime(config: {
|
|
34
40
|
readonly runtimeStore?: RuntimeStore | null;
|
|
35
41
|
readonly runtimeBus?: RuntimeEventBus | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/watchers/registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAuB,MAAM,sCAAsC,CAAC;AAC5G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/watchers/registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAuB,MAAM,sCAAsC,CAAC;AAC5G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAevE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,QAAQ,CAAC,GAAG,CAAC,E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AE,2BAA2B,GAAG,aAAa;IAezE,IAAI,IAAI,aAAa,EAAE;IAsBvB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAiB5C,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAwC9C,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,SAAY,GAAG,aAAa,GAAG,IAAI;IA+B3D,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAS9D,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAqBlC,OAAO,CAAC,YAAY;IAmCpB,OAAO,CAAC,eAAe;YAYT,UAAU;IA6DxB,OAAO,CAAC,gBAAgB;IA+DxB,OAAO,CAAC,OAAO;CAShB"}
|
|
@@ -4,6 +4,7 @@ import { summarizeError } from '../utils/error-display.js';
|
|
|
4
4
|
import { emitWatcherFailed, emitWatcherHeartbeat, emitWatcherStarted, emitWatcherStopped, } from '../runtime/emitters/index.js';
|
|
5
5
|
import { loadWatcherSnapshotFromPath, resolveWatcherStorePath, saveWatcherSnapshotToPath, } from './store.js';
|
|
6
6
|
import { instrumentedFetch } from '../utils/fetch-with-timeout.js';
|
|
7
|
+
import { isFeatureGateEnabled, requireFeatureGate } from '../runtime/feature-flags/index.js';
|
|
7
8
|
function now() {
|
|
8
9
|
return Date.now();
|
|
9
10
|
}
|
|
@@ -83,9 +84,23 @@ export class WatcherRegistry {
|
|
|
83
84
|
storePath;
|
|
84
85
|
runtimeDispatch = null;
|
|
85
86
|
runtimeBus = null;
|
|
87
|
+
featureFlags;
|
|
86
88
|
loaded = false;
|
|
87
89
|
constructor(options = {}) {
|
|
88
90
|
this.storePath = resolveWatcherStorePath(options.storePath);
|
|
91
|
+
this.featureFlags = options.featureFlags ?? null;
|
|
92
|
+
}
|
|
93
|
+
isEnabled() {
|
|
94
|
+
return isFeatureGateEnabled(this.featureFlags, 'watcher-framework', ['managed-watcher-services']);
|
|
95
|
+
}
|
|
96
|
+
requireEnabled(operation) {
|
|
97
|
+
requireFeatureGate(this.featureFlags, 'watcher-framework', operation, ['managed-watcher-services']);
|
|
98
|
+
}
|
|
99
|
+
clearTimers() {
|
|
100
|
+
for (const timer of this.timers.values()) {
|
|
101
|
+
clearInterval(timer);
|
|
102
|
+
}
|
|
103
|
+
this.timers.clear();
|
|
89
104
|
}
|
|
90
105
|
attachRuntime(config) {
|
|
91
106
|
if (config.runtimeStore) {
|
|
@@ -99,6 +114,7 @@ export class WatcherRegistry {
|
|
|
99
114
|
}
|
|
100
115
|
}
|
|
101
116
|
registerWatcher(input) {
|
|
117
|
+
this.requireEnabled('register watcher');
|
|
102
118
|
this.ensureLoaded();
|
|
103
119
|
const existing = this.watchers.get(input.id)?.record;
|
|
104
120
|
const wasRunning = existing?.state === 'running' || existing?.state === 'starting' || existing?.state === 'degraded';
|
|
@@ -151,6 +167,10 @@ export class WatcherRegistry {
|
|
|
151
167
|
});
|
|
152
168
|
}
|
|
153
169
|
list() {
|
|
170
|
+
if (!this.isEnabled()) {
|
|
171
|
+
this.clearTimers();
|
|
172
|
+
return [];
|
|
173
|
+
}
|
|
154
174
|
this.ensureLoaded();
|
|
155
175
|
const refreshed = [];
|
|
156
176
|
let changed = false;
|
|
@@ -168,6 +188,10 @@ export class WatcherRegistry {
|
|
|
168
188
|
return sortWatchers(refreshed);
|
|
169
189
|
}
|
|
170
190
|
getWatcher(id) {
|
|
191
|
+
if (!this.isEnabled()) {
|
|
192
|
+
this.clearTimers();
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
171
195
|
this.ensureLoaded();
|
|
172
196
|
const watcher = this.watchers.get(id);
|
|
173
197
|
if (!watcher)
|
|
@@ -181,6 +205,7 @@ export class WatcherRegistry {
|
|
|
181
205
|
return normalized;
|
|
182
206
|
}
|
|
183
207
|
startWatcher(id) {
|
|
208
|
+
this.requireEnabled('start watcher');
|
|
184
209
|
this.ensureLoaded();
|
|
185
210
|
const watcher = this.watchers.get(id);
|
|
186
211
|
if (!watcher)
|
|
@@ -219,6 +244,7 @@ export class WatcherRegistry {
|
|
|
219
244
|
return started;
|
|
220
245
|
}
|
|
221
246
|
stopWatcher(id, reason = 'stopped') {
|
|
247
|
+
this.requireEnabled('stop watcher');
|
|
222
248
|
this.ensureLoaded();
|
|
223
249
|
const watcher = this.watchers.get(id);
|
|
224
250
|
if (!watcher)
|
|
@@ -249,6 +275,7 @@ export class WatcherRegistry {
|
|
|
249
275
|
return stopped;
|
|
250
276
|
}
|
|
251
277
|
async runWatcherNow(id) {
|
|
278
|
+
this.requireEnabled('run watcher');
|
|
252
279
|
this.ensureLoaded();
|
|
253
280
|
const watcher = this.watchers.get(id);
|
|
254
281
|
if (!watcher)
|
|
@@ -257,6 +284,7 @@ export class WatcherRegistry {
|
|
|
257
284
|
return this.getWatcher(id);
|
|
258
285
|
}
|
|
259
286
|
removeWatcher(id) {
|
|
287
|
+
this.requireEnabled('remove watcher');
|
|
260
288
|
this.ensureLoaded();
|
|
261
289
|
const watcher = this.watchers.get(id);
|
|
262
290
|
if (!watcher)
|
|
@@ -277,6 +305,8 @@ export class WatcherRegistry {
|
|
|
277
305
|
return removed;
|
|
278
306
|
}
|
|
279
307
|
ensureLoaded() {
|
|
308
|
+
if (!this.isEnabled())
|
|
309
|
+
return;
|
|
280
310
|
if (this.loaded)
|
|
281
311
|
return;
|
|
282
312
|
const snapshot = loadWatcherSnapshotFromPath(this.storePath);
|
|
@@ -320,6 +350,8 @@ export class WatcherRegistry {
|
|
|
320
350
|
};
|
|
321
351
|
}
|
|
322
352
|
async runWatcher(id) {
|
|
353
|
+
if (!this.isEnabled())
|
|
354
|
+
return;
|
|
323
355
|
if (this.inFlight.has(id))
|
|
324
356
|
return;
|
|
325
357
|
const watcher = this.watchers.get(id);
|