@pellux/goodvibes-sdk 0.18.16 → 0.18.18
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-runner.d.ts +5 -4
- package/dist/_internal/platform/agents/orchestrator-runner.d.ts.map +1 -1
- package/dist/_internal/platform/agents/orchestrator-runner.js +9 -8
- package/dist/_internal/platform/agents/orchestrator.d.ts.map +1 -1
- package/dist/_internal/platform/agents/orchestrator.js +1 -0
- package/dist/_internal/platform/agents/wrfc-controller.d.ts +2 -1
- package/dist/_internal/platform/agents/wrfc-controller.d.ts.map +1 -1
- package/dist/_internal/platform/agents/wrfc-controller.js +6 -6
- package/dist/_internal/platform/agents/wrfc-workmap.d.ts +4 -1
- package/dist/_internal/platform/agents/wrfc-workmap.d.ts.map +1 -1
- package/dist/_internal/platform/agents/wrfc-workmap.js +4 -2
- package/dist/_internal/platform/automation/schedules.js +1 -1
- package/dist/_internal/platform/bookmarks/manager.d.ts +1 -1
- package/dist/_internal/platform/bookmarks/manager.js +1 -1
- package/dist/_internal/platform/config/manager.d.ts +3 -2
- package/dist/_internal/platform/config/manager.d.ts.map +1 -1
- package/dist/_internal/platform/config/manager.js +12 -7
- package/dist/_internal/platform/config/schema-domain-core.js +1 -1
- package/dist/_internal/platform/config/schema-domain-runtime.js +1 -1
- package/dist/_internal/platform/config/secrets.d.ts +6 -4
- package/dist/_internal/platform/config/secrets.d.ts.map +1 -1
- package/dist/_internal/platform/config/secrets.js +19 -16
- package/dist/_internal/platform/config/service-registry.d.ts +1 -1
- package/dist/_internal/platform/config/service-registry.js +1 -1
- package/dist/_internal/platform/config/subscription-providers.js +1 -1
- package/dist/_internal/platform/daemon/cli.js +1 -1
- package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade-composition.js +4 -0
- package/dist/_internal/platform/daemon/service-manager.d.ts +8 -0
- package/dist/_internal/platform/daemon/service-manager.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/service-manager.js +41 -27
- package/dist/_internal/platform/discovery/mcp-scanner.d.ts +3 -1
- package/dist/_internal/platform/discovery/mcp-scanner.d.ts.map +1 -1
- package/dist/_internal/platform/discovery/mcp-scanner.js +6 -5
- package/dist/_internal/platform/discovery/scanner.d.ts +3 -1
- package/dist/_internal/platform/discovery/scanner.d.ts.map +1 -1
- package/dist/_internal/platform/discovery/scanner.js +3 -2
- package/dist/_internal/platform/input/keybindings.d.ts +3 -1
- package/dist/_internal/platform/input/keybindings.d.ts.map +1 -1
- package/dist/_internal/platform/input/keybindings.js +7 -3
- package/dist/_internal/platform/intelligence/config.d.ts +1 -1
- package/dist/_internal/platform/intelligence/config.d.ts.map +1 -1
- package/dist/_internal/platform/intelligence/config.js +8 -4
- package/dist/_internal/platform/intelligence/facade.d.ts +1 -1
- package/dist/_internal/platform/intelligence/facade.js +2 -2
- package/dist/_internal/platform/plugins/manager.d.ts.map +1 -1
- package/dist/_internal/platform/plugins/manager.js +5 -3
- package/dist/_internal/platform/profiles/manager.d.ts +1 -1
- package/dist/_internal/platform/profiles/manager.js +1 -1
- package/dist/_internal/platform/providers/anthropic-compat.d.ts +1 -1
- package/dist/_internal/platform/providers/anthropic-compat.js +1 -1
- package/dist/_internal/platform/providers/custom-loader.d.ts +1 -1
- package/dist/_internal/platform/providers/registry.d.ts +2 -2
- package/dist/_internal/platform/providers/registry.js +2 -2
- package/dist/_internal/platform/runtime/bootstrap-background.d.ts +2 -0
- package/dist/_internal/platform/runtime/bootstrap-background.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/bootstrap-background.js +6 -6
- package/dist/_internal/platform/runtime/ecosystem/catalog.js +6 -6
- package/dist/_internal/platform/runtime/guidance.d.ts +1 -0
- package/dist/_internal/platform/runtime/guidance.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/guidance.js +6 -2
- package/dist/_internal/platform/runtime/remote/distributed-runtime-manager.d.ts +1 -1
- package/dist/_internal/platform/runtime/remote/distributed-runtime-manager.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/remote/distributed-runtime-manager.js +4 -3
- package/dist/_internal/platform/runtime/sandbox/provisioning.d.ts +7 -4
- package/dist/_internal/platform/runtime/sandbox/provisioning.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/sandbox/provisioning.js +9 -8
- package/dist/_internal/platform/runtime/services.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/services.js +6 -4
- package/dist/_internal/platform/runtime/session-persistence.d.ts +1 -0
- package/dist/_internal/platform/runtime/session-persistence.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/session-persistence.js +4 -4
- package/dist/_internal/platform/runtime/surface-root.d.ts +4 -0
- package/dist/_internal/platform/runtime/surface-root.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/surface-root.js +15 -0
- package/dist/_internal/platform/runtime/worktree/registry.d.ts +5 -1
- package/dist/_internal/platform/runtime/worktree/registry.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/worktree/registry.js +20 -17
- package/dist/_internal/platform/scheduler/scheduler.d.ts +1 -1
- package/dist/_internal/platform/scheduler/scheduler.js +1 -1
- package/dist/_internal/platform/sessions/manager.d.ts +5 -2
- package/dist/_internal/platform/sessions/manager.d.ts.map +1 -1
- package/dist/_internal/platform/sessions/manager.js +4 -3
- package/dist/_internal/platform/sessions/orchestration/registry.d.ts +4 -5
- package/dist/_internal/platform/sessions/orchestration/registry.d.ts.map +1 -1
- package/dist/_internal/platform/sessions/orchestration/registry.js +7 -8
- package/dist/_internal/platform/tools/fetch/schema.d.ts +1 -1
- package/dist/_internal/platform/tools/fetch/schema.js +1 -1
- package/dist/_internal/platform/tools/index.js +6 -6
- package/dist/_internal/platform/tools/packet/index.d.ts +4 -1
- package/dist/_internal/platform/tools/packet/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/packet/index.js +5 -2
- package/dist/_internal/platform/tools/query/index.d.ts +4 -1
- package/dist/_internal/platform/tools/query/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/query/index.js +5 -2
- package/dist/_internal/platform/tools/registry-tool/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/registry-tool/index.js +2 -4
- package/dist/_internal/platform/tools/registry-tool/skill-loader.d.ts.map +1 -1
- package/dist/_internal/platform/tools/registry-tool/skill-loader.js +1 -2
- package/dist/_internal/platform/tools/team/index.d.ts +3 -0
- package/dist/_internal/platform/tools/team/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/team/index.js +124 -119
- package/dist/_internal/platform/tools/worklist/index.d.ts +3 -0
- package/dist/_internal/platform/tools/worklist/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/worklist/index.js +108 -103
- package/dist/_internal/platform/watchers/store.d.ts.map +1 -1
- package/dist/_internal/platform/watchers/store.js +3 -2
- package/package.json +1 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { ToolRegistry } from '
|
|
1
|
+
import { ToolRegistry } from '../tools/registry.js';
|
|
2
2
|
import type { ProviderRegistry } from '../providers/registry.js';
|
|
3
3
|
import type { ProviderOptimizer } from '../providers/optimizer.js';
|
|
4
4
|
import type { AgentRecord } from '../tools/agent/index.js';
|
|
5
5
|
import type { LLMProvider } from '../providers/interface.js';
|
|
6
|
-
import type { ProcessManager } from '
|
|
7
|
-
import type { FeatureFlagManager } from '
|
|
6
|
+
import type { ProcessManager } from '../tools/shared/process-manager.js';
|
|
7
|
+
import type { FeatureFlagManager } from '../runtime/feature-flags/manager.js';
|
|
8
8
|
import type { RuntimeEventBus } from '../runtime/events/index.js';
|
|
9
9
|
import type { AgentMessageBus } from './message-bus.js';
|
|
10
10
|
import type { KnowledgeService } from '../knowledge/index.js';
|
|
11
|
-
import type { ArchetypeLoader } from '
|
|
11
|
+
import type { ArchetypeLoader } from './archetypes.js';
|
|
12
12
|
type EmitterContext = import('../runtime/emitters/index.js').EmitterContext;
|
|
13
13
|
export interface AgentOrchestratorRunContext {
|
|
14
14
|
readonly workingDirectory: string;
|
|
15
|
+
readonly surfaceRoot?: string;
|
|
15
16
|
readonly runtimeBus: RuntimeEventBus | null;
|
|
16
17
|
readonly featureFlagManager: FeatureFlagManager | null;
|
|
17
18
|
readonly emitterContext: (agentId: string) => EmitterContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-runner.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/agents/orchestrator-runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"orchestrator-runner.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/agents/orchestrator-runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAKjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAMnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAWvD,KAAK,cAAc,GAAG,OAAO,8BAA8B,EAAE,cAAc,CAAC;AAE5E,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9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I,CAAC,gBAAgB,EAAE,YAAY,GAAG,aAAa,CAAC,EACtE,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAC9C,uBAAuB,EAAE,MAAM,KAC5B,KAAK,CAAC;QAAE,QAAQ,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClF;AAiRD,wBAAsB,YAAY,CAChC,OAAO,EAAE,2BAA2B,EACpC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CAgUf"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ConversationManager } from '../core/conversation.js';
|
|
2
|
-
import { ToolRegistry } from '
|
|
2
|
+
import { ToolRegistry } from '../tools/registry.js';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { logger } from '
|
|
5
|
-
import { ConsecutiveErrorBreaker } from '
|
|
6
|
-
import { isRateLimitOrQuotaError, isContextSizeExceededError } from '
|
|
4
|
+
import { logger } from '../utils/logger.js';
|
|
5
|
+
import { ConsecutiveErrorBreaker } from '../core/circuit-breaker.js';
|
|
6
|
+
import { isRateLimitOrQuotaError, isContextSizeExceededError } from '../types/errors.js';
|
|
7
7
|
import { AgentSession } from './session.js';
|
|
8
8
|
import { estimateTokens, estimateConversationTokens, compactSmallWindow, } from '../core/context-compaction.js';
|
|
9
|
-
import { summarizeToolArgs } from '
|
|
9
|
+
import { summarizeToolArgs } from './orchestrator-utils.js';
|
|
10
10
|
import { buildLayeredOrchestratorSystemPrompt, buildOrchestratorSystemPrompt } from './orchestrator-prompts.js';
|
|
11
|
-
import { summarizeError } from '
|
|
11
|
+
import { summarizeError } from '../utils/error-display.js';
|
|
12
|
+
import { resolveScopedDirectory } from '../runtime/surface-root.js';
|
|
12
13
|
const MAX_TURNS = 50;
|
|
13
14
|
const NETWORK_RETRY_DELAYS_MS = [5_000, 10_000, 20_000, 40_000, 60_000];
|
|
14
15
|
const RATE_LIMIT_RETRY_DELAY_MS = 60_000;
|
|
@@ -254,8 +255,8 @@ export async function runAgentTask(context, record) {
|
|
|
254
255
|
record.model = record.model ?? primaryRoute.requestedModelId;
|
|
255
256
|
record.provider = record.provider ?? activeRoute.provider.name;
|
|
256
257
|
session = new AgentSession(record.id, modelId, record.provider ?? currentModel.provider ?? 'unknown', {
|
|
257
|
-
sessionsDir:
|
|
258
|
-
stateDir:
|
|
258
|
+
sessionsDir: resolveScopedDirectory(context.workingDirectory, context.surfaceRoot, 'sessions'),
|
|
259
|
+
stateDir: resolveScopedDirectory(context.workingDirectory, context.surfaceRoot, 'state'),
|
|
259
260
|
});
|
|
260
261
|
session.appendMessage({ type: 'session_config', template: record.template, task: record.task, tools: record.tools, model: modelId, provider: record.provider ?? 'unknown', timestamp: new Date().toISOString() });
|
|
261
262
|
const toolRegistry = context.buildScopedRegistry(record.tools, context.getFullRegistry());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/agents/orchestrator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAA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B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,wBAAwB;IA0ChC,OAAO,CAAC,sBAAsB;IAgD9B,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,0BAA0B;IAiClC,OAAO,CAAC,gBAAgB;IAkCxB,uDAAuD;IACjD,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD"}
|
|
@@ -285,6 +285,7 @@ export class AgentOrchestrator {
|
|
|
285
285
|
createRunContext() {
|
|
286
286
|
return {
|
|
287
287
|
workingDirectory: this.toolDeps.workingDirectory,
|
|
288
|
+
surfaceRoot: this.toolDeps.surfaceRoot,
|
|
288
289
|
runtimeBus: this.runtimeBus,
|
|
289
290
|
featureFlagManager: this.featureFlagManager,
|
|
290
291
|
emitterContext: (agentId) => this.emitterContext(agentId),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentMessageBus } from './message-bus.js';
|
|
2
2
|
import type { WrfcChain } from './wrfc-types.js';
|
|
3
|
-
import { WrfcWorkmap } from '
|
|
3
|
+
import { WrfcWorkmap } from './wrfc-workmap.js';
|
|
4
4
|
import { AgentWorktree } from './worktree.js';
|
|
5
5
|
import type { ConfigManager } from '../config/manager.js';
|
|
6
6
|
import type { AgentRecord } from '../tools/agent/index.js';
|
|
@@ -28,6 +28,7 @@ export declare class WrfcController {
|
|
|
28
28
|
readonly agentManager: AgentManagerLike;
|
|
29
29
|
readonly configManager: Pick<ConfigManager, 'get' | 'getCategory'>;
|
|
30
30
|
readonly projectRoot: string;
|
|
31
|
+
readonly surfaceRoot?: string;
|
|
31
32
|
readonly createWorktree?: () => WrfcWorktreeOps;
|
|
32
33
|
});
|
|
33
34
|
createChain(engineerRecord: AgentRecord): WrfcChain;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrfc-controller.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/agents/wrfc-controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASnD,OAAO,KAAK,EAAkC,SAAS,EAAa,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"wrfc-controller.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/agents/wrfc-controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASnD,OAAO,KAAK,EAAkC,SAAS,EAAa,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,KAAK,EAAc,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAM9E,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAe1B,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAczG,KAAK,eAAe,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC;AAEhE,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;IACvD,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAA6B;IACnE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,OA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IA8EhC,OAAO,CAAC,oBAAoB;YAQd,sBAAsB;YAqCtB,UAAU;IAuCxB,OAAO,CAAC,SAAS;YA2BH,WAAW;IAyBzB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,cAAc;IAEtB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,wBAAwB;IAehC,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,eAAe;CAKxB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { AgentMessageBus } from './message-bus.js';
|
|
4
|
-
import {} from '
|
|
4
|
+
import {} from './completion-report.js';
|
|
5
5
|
import { buildGateFailureTask, buildFixTask, buildReviewTask, parseEngineerCompletionReport, parseReviewerCompletionReport, } from './wrfc-reporting.js';
|
|
6
|
-
import { WrfcWorkmap } from '
|
|
6
|
+
import { WrfcWorkmap } from './wrfc-workmap.js';
|
|
7
7
|
import { AgentWorktree } from './worktree.js';
|
|
8
|
-
import { completePlanItemsForAgent } from '
|
|
9
|
-
import { logger } from '
|
|
10
|
-
import { summarizeError } from '
|
|
8
|
+
import { completePlanItemsForAgent } from './wrfc-plan-sync.js';
|
|
9
|
+
import { logger } from '../utils/logger.js';
|
|
10
|
+
import { summarizeError } from '../utils/error-display.js';
|
|
11
11
|
import { emitWorkflowChainFailed, emitWorkflowFixAttempted, emitWorkflowReviewCompleted, } from '../runtime/emitters/index.js';
|
|
12
12
|
import { getWrfcAutoCommit, getWrfcMaxFixAttempts, getWrfcScoreThreshold, } from './wrfc-config.js';
|
|
13
13
|
import { completeWrfcOrchestrationNode, createWrfcWorkflowContext, emitWrfcAutoCommitted, emitWrfcCascadeAbort, emitWrfcChainCreated, emitWrfcChainPassed, emitWrfcGraphCreated, emitWrfcStateChanged, failWrfcOrchestrationNode, startWrfcOrchestrationNode, } from './wrfc-runtime-events.js';
|
|
@@ -47,7 +47,7 @@ export class WrfcController {
|
|
|
47
47
|
this.projectRoot = deps.projectRoot;
|
|
48
48
|
this.createWorktree = deps.createWorktree ?? (() => new AgentWorktree(this.projectRoot));
|
|
49
49
|
this.sessionId = crypto.randomUUID().slice(0, 8);
|
|
50
|
-
this.workmap = new WrfcWorkmap(this.projectRoot, this.sessionId);
|
|
50
|
+
this.workmap = new WrfcWorkmap(this.projectRoot, this.sessionId, { surfaceRoot: deps.surfaceRoot });
|
|
51
51
|
this.setupListeners();
|
|
52
52
|
}
|
|
53
53
|
createChain(engineerRecord) {
|
|
@@ -18,7 +18,10 @@ export interface WorkmapEntry {
|
|
|
18
18
|
}
|
|
19
19
|
export declare class WrfcWorkmap {
|
|
20
20
|
private filePath;
|
|
21
|
-
constructor(projectRoot: string, sessionId: string
|
|
21
|
+
constructor(projectRoot: string, sessionId: string, options?: {
|
|
22
|
+
readonly surfaceRoot?: string;
|
|
23
|
+
readonly sessionsDir?: string;
|
|
24
|
+
});
|
|
22
25
|
private dirCreated;
|
|
23
26
|
append(entry: WorkmapEntry): void;
|
|
24
27
|
/** Read all entries, optionally filtered by wrfcId */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrfc-workmap.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/agents/wrfc-workmap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wrfc-workmap.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/agents/wrfc-workmap.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,GAAG,iBAAiB,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,cAAc,CAAC;IACjH,OAA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';
|
|
3
3
|
import { logger } from '../utils/logger.js';
|
|
4
4
|
import { summarizeError } from '../utils/error-display.js';
|
|
5
|
+
import { resolveScopedDirectory } from '../runtime/surface-root.js';
|
|
5
6
|
export class WrfcWorkmap {
|
|
6
7
|
filePath;
|
|
7
|
-
constructor(projectRoot, sessionId) {
|
|
8
|
-
|
|
8
|
+
constructor(projectRoot, sessionId, options) {
|
|
9
|
+
const sessionsDir = options?.sessionsDir ?? resolveScopedDirectory(projectRoot, options?.surfaceRoot, 'sessions');
|
|
10
|
+
this.filePath = join(sessionsDir, `${sessionId}_workmap.jsonl`);
|
|
9
11
|
}
|
|
10
12
|
dirCreated = false;
|
|
11
13
|
append(entry) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { TaskScheduler } from '../scheduler/scheduler.js';
|
|
3
3
|
const EVERY_PATTERN = /^(\d+(?:\.\d+)?)(ms|s|m|h|d)$/;
|
|
4
|
-
const CRON_HELPER_STATE_PATH = '.goodvibes
|
|
4
|
+
const CRON_HELPER_STATE_PATH = '.goodvibes/.automation-cron-helper.json';
|
|
5
5
|
export const DEFAULT_TOP_OF_HOUR_STAGGER_MS = 5 * 60 * 1_000;
|
|
6
6
|
function createCronHelper() {
|
|
7
7
|
return new TaskScheduler(CRON_HELPER_STATE_PATH);
|
|
@@ -13,7 +13,7 @@ export interface BookmarkEntry {
|
|
|
13
13
|
* BookmarkManager - Tracks bookmarked blocks and saves block content to disk.
|
|
14
14
|
*
|
|
15
15
|
* Bookmarks are stored in memory for the session. Saved block content is
|
|
16
|
-
* written to
|
|
16
|
+
* written to the configured bookmarks directory.
|
|
17
17
|
*/
|
|
18
18
|
export declare class BookmarkManager {
|
|
19
19
|
private bookmarks;
|
|
@@ -5,7 +5,7 @@ import { logger } from '../utils/logger.js';
|
|
|
5
5
|
* BookmarkManager - Tracks bookmarked blocks and saves block content to disk.
|
|
6
6
|
*
|
|
7
7
|
* Bookmarks are stored in memory for the session. Saved block content is
|
|
8
|
-
* written to
|
|
8
|
+
* written to the configured bookmarks directory.
|
|
9
9
|
*/
|
|
10
10
|
export class BookmarkManager {
|
|
11
11
|
bookmarks = new Map();
|
|
@@ -11,6 +11,7 @@ interface ConfigCliOverrides {
|
|
|
11
11
|
autoApprove?: boolean;
|
|
12
12
|
systemPromptFile?: string;
|
|
13
13
|
workingDir?: string;
|
|
14
|
+
surfaceRoot?: string;
|
|
14
15
|
}
|
|
15
16
|
export type ConfigOverrides = ConfigCliOverrides & ({
|
|
16
17
|
configDir: string;
|
|
@@ -27,7 +28,7 @@ export interface ConfigSetOptions {
|
|
|
27
28
|
/**
|
|
28
29
|
* ConfigManager — Layered, mutable, persistent config system.
|
|
29
30
|
*
|
|
30
|
-
* Load order: defaults < global
|
|
31
|
+
* Load order: defaults < global surface settings < project surface settings < CLI overrides
|
|
31
32
|
* API keys are never persisted — loaded from env vars only.
|
|
32
33
|
*/
|
|
33
34
|
export declare class ConfigManager {
|
|
@@ -69,7 +70,7 @@ export declare class ConfigManager {
|
|
|
69
70
|
getSchema(): ConfigSetting[];
|
|
70
71
|
/** Persist current config to global TUI settings file. */
|
|
71
72
|
save(): void;
|
|
72
|
-
/** Persist current config to project-level
|
|
73
|
+
/** Persist current config to the project-level surface settings file. */
|
|
73
74
|
saveProject(): void;
|
|
74
75
|
/** Load config from disk: global then project (project wins). Deep-merges with defaults. */
|
|
75
76
|
load(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/config/manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAI3H,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/config/manager.ts"],"names":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CAAC,CAAC,SAAS,MAAM,eAAe,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAWrG;;;OAGG;IACH,KAAK,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI;CAY7B"}
|
|
@@ -4,6 +4,7 @@ import { DEFAULT_CONFIG, CONFIG_SCHEMA } from '@pellux/goodvibes-sdk/platform/co
|
|
|
4
4
|
import { ConfigError } from '@pellux/goodvibes-sdk/platform/types/errors';
|
|
5
5
|
import { logger } from '@pellux/goodvibes-sdk/platform/utils/logger';
|
|
6
6
|
import { getManagedSettingLock } from '../runtime/settings/control-plane.js';
|
|
7
|
+
import { requireSurfaceRoot, resolveSurfaceDirectory, resolveSurfaceSharedFile } from '../runtime/surface-root.js';
|
|
7
8
|
import { summarizeError } from '@pellux/goodvibes-sdk/platform/utils/error-display';
|
|
8
9
|
const DEFAULT_CONFIG_SNAPSHOT = structuredClone(DEFAULT_CONFIG);
|
|
9
10
|
const PERMISSION_TOOL_KEYS = new Set(Object.keys(DEFAULT_CONFIG.permissions.tools));
|
|
@@ -36,7 +37,7 @@ function requireAbsoluteOwnedPath(path, name) {
|
|
|
36
37
|
return resolve(trimmed);
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
|
-
* Ensure the shared ~/.goodvibes
|
|
40
|
+
* Ensure the shared ~/.goodvibes/<surface>.json exists (empty object if not).
|
|
40
41
|
* This is reserved for future cross-app use — no TUI settings go here.
|
|
41
42
|
*/
|
|
42
43
|
function ensureSharedConfig(sharedPath) {
|
|
@@ -46,14 +47,14 @@ function ensureSharedConfig(sharedPath) {
|
|
|
46
47
|
writeFileSync(sharedPath, '{}\n', 'utf-8');
|
|
47
48
|
}
|
|
48
49
|
catch (err) {
|
|
49
|
-
logger.debug('Could not create shared
|
|
50
|
+
logger.debug('Could not create shared surface config (non-fatal)', { error: summarizeError(err) });
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
55
|
* ConfigManager — Layered, mutable, persistent config system.
|
|
55
56
|
*
|
|
56
|
-
* Load order: defaults < global
|
|
57
|
+
* Load order: defaults < global surface settings < project surface settings < CLI overrides
|
|
57
58
|
* API keys are never persisted — loaded from env vars only.
|
|
58
59
|
*/
|
|
59
60
|
export class ConfigManager {
|
|
@@ -70,16 +71,20 @@ export class ConfigManager {
|
|
|
70
71
|
const homeDirectory = requireAbsoluteOwnedPath(roots.homeDir, 'homeDir') ?? null;
|
|
71
72
|
const workingDirectory = requireAbsoluteOwnedPath(overrides.workingDir, 'workingDir') ?? null;
|
|
72
73
|
const sharedConfigPath = requireAbsoluteOwnedPath(roots.sharedConfigPath, 'sharedConfigPath');
|
|
73
|
-
const
|
|
74
|
+
const surfaceRoot = roots.surfaceRoot ? requireSurfaceRoot(roots.surfaceRoot, 'ConfigManager surfaceRoot') : null;
|
|
75
|
+
if ((!configDir || workingDirectory || homeDirectory) && !surfaceRoot) {
|
|
76
|
+
throw new Error('ConfigManager surfaceRoot is required when deriving config paths from homeDir/workingDir.');
|
|
77
|
+
}
|
|
78
|
+
const base = configDir ?? resolveSurfaceDirectory(homeDirectory, surfaceRoot);
|
|
74
79
|
this.configDir = base;
|
|
75
80
|
this.configPath = join(base, 'settings.json');
|
|
76
81
|
this.workingDirectory = workingDirectory;
|
|
77
82
|
this.homeDirectory = homeDirectory;
|
|
78
83
|
this.projectConfigPath = this.workingDirectory
|
|
79
|
-
?
|
|
84
|
+
? resolveSurfaceDirectory(this.workingDirectory, surfaceRoot, 'settings.json')
|
|
80
85
|
: null;
|
|
81
86
|
this.config = cloneDefaultConfig();
|
|
82
|
-
const ownedSharedConfigPath = sharedConfigPath ?? (this.homeDirectory ?
|
|
87
|
+
const ownedSharedConfigPath = sharedConfigPath ?? (this.homeDirectory ? resolveSurfaceSharedFile(this.homeDirectory, surfaceRoot) : null);
|
|
83
88
|
if (ownedSharedConfigPath) {
|
|
84
89
|
ensureSharedConfig(ownedSharedConfigPath);
|
|
85
90
|
}
|
|
@@ -213,7 +218,7 @@ export class ConfigManager {
|
|
|
213
218
|
logger.debug('Config save failed (non-fatal)', { error: summarizeError(err) });
|
|
214
219
|
}
|
|
215
220
|
}
|
|
216
|
-
/** Persist current config to project-level
|
|
221
|
+
/** Persist current config to the project-level surface settings file. */
|
|
217
222
|
saveProject() {
|
|
218
223
|
if (!this.projectConfigPath) {
|
|
219
224
|
throw new Error('ConfigManager.saveProject requires an explicit workingDir.');
|
|
@@ -528,7 +528,7 @@ export const coreTailConfigSettings = [
|
|
|
528
528
|
key: 'tools.hooksFile',
|
|
529
529
|
type: 'string',
|
|
530
530
|
default: 'hooks.json',
|
|
531
|
-
description: 'Hook configuration file name (relative to .goodvibes
|
|
531
|
+
description: 'Hook configuration file name (relative to the host .goodvibes data directory)',
|
|
532
532
|
},
|
|
533
533
|
{
|
|
534
534
|
key: 'wrfc.scoreThreshold',
|
|
@@ -309,7 +309,7 @@ export const runtimeSecondaryConfigSettings = [
|
|
|
309
309
|
key: 'service.logPath',
|
|
310
310
|
type: 'string',
|
|
311
311
|
default: '',
|
|
312
|
-
description: 'File path for daemon/service logs (empty = platform default under
|
|
312
|
+
description: 'File path for daemon/service logs (empty = platform default under the configured service directory)',
|
|
313
313
|
},
|
|
314
314
|
{
|
|
315
315
|
key: 'network.outboundTls.mode',
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Resolution order:
|
|
5
5
|
* 1. Environment variable (process.env[key])
|
|
6
|
-
* 2. Project/ancestor secure stores (.goodvibes
|
|
7
|
-
* 3. Project/ancestor plaintext stores (.goodvibes
|
|
8
|
-
* 4. User secure store (~/.goodvibes
|
|
9
|
-
* 5. User plaintext store (~/.goodvibes
|
|
6
|
+
* 2. Project/ancestor secure stores (.goodvibes/<surface>/secrets.enc), nearest first
|
|
7
|
+
* 3. Project/ancestor plaintext stores (.goodvibes/<surface>.secrets.json), nearest first
|
|
8
|
+
* 4. User secure store (~/.goodvibes/<surface>/secrets.enc)
|
|
9
|
+
* 5. User plaintext store (~/.goodvibes/<surface>.secrets.json)
|
|
10
10
|
* 6. If a resolved value is a SecretRef, resolve through the referenced provider
|
|
11
11
|
*
|
|
12
12
|
* The active policy decides whether plaintext stores are eligible:
|
|
@@ -56,6 +56,7 @@ export interface SecretStorageReview {
|
|
|
56
56
|
export interface SecretsManagerOptions {
|
|
57
57
|
readonly projectRoot: string;
|
|
58
58
|
readonly globalHome: string;
|
|
59
|
+
readonly surfaceRoot: string;
|
|
59
60
|
readonly configManager?: Pick<ConfigManager, 'get'>;
|
|
60
61
|
readonly policy?: SecretStorageMode;
|
|
61
62
|
readonly secureProjectFilePath?: string;
|
|
@@ -66,6 +67,7 @@ export interface SecretsManagerOptions {
|
|
|
66
67
|
export declare class SecretsManager {
|
|
67
68
|
private readonly encKey;
|
|
68
69
|
private readonly options;
|
|
70
|
+
private readonly surfaceRoot;
|
|
69
71
|
constructor(options: SecretsManagerOptions);
|
|
70
72
|
getGlobalHome(): string;
|
|
71
73
|
get(key: string): Promise<string | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/config/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/config/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;AAC5F,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;AAC7C,MAAM,MAAM,mBAAmB,G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AAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB3E,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,YAAY;IA2CpB,OAAO,CAAC,qBAAqB;IAiC7B,OAAO,CAAC,kBAAkB;IAkC1B,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,kBAAkB;CAK3B"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Resolution order:
|
|
5
5
|
* 1. Environment variable (process.env[key])
|
|
6
|
-
* 2. Project/ancestor secure stores (.goodvibes
|
|
7
|
-
* 3. Project/ancestor plaintext stores (.goodvibes
|
|
8
|
-
* 4. User secure store (~/.goodvibes
|
|
9
|
-
* 5. User plaintext store (~/.goodvibes
|
|
6
|
+
* 2. Project/ancestor secure stores (.goodvibes/<surface>/secrets.enc), nearest first
|
|
7
|
+
* 3. Project/ancestor plaintext stores (.goodvibes/<surface>.secrets.json), nearest first
|
|
8
|
+
* 4. User secure store (~/.goodvibes/<surface>/secrets.enc)
|
|
9
|
+
* 5. User plaintext store (~/.goodvibes/<surface>.secrets.json)
|
|
10
10
|
* 6. If a resolved value is a SecretRef, resolve through the referenced provider
|
|
11
11
|
*
|
|
12
12
|
* The active policy decides whether plaintext stores are eligible:
|
|
@@ -22,6 +22,7 @@ import { hostname, userInfo } from 'os';
|
|
|
22
22
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
23
23
|
import { getSecretRefSource, isSecretRefInput, resolveSecretRef } from '@pellux/goodvibes-sdk/platform/config/secret-refs';
|
|
24
24
|
import { logger } from '@pellux/goodvibes-sdk/platform/utils/logger';
|
|
25
|
+
import { requireSurfaceRoot, resolveSurfaceDirectory, resolveSurfaceSharedFile } from '../runtime/surface-root.js';
|
|
25
26
|
import { summarizeError } from '@pellux/goodvibes-sdk/platform/utils/error-display';
|
|
26
27
|
function requireAbsoluteOwnedPath(path, name) {
|
|
27
28
|
const trimmed = path.trim();
|
|
@@ -91,8 +92,10 @@ function collectAncestorRoots(start) {
|
|
|
91
92
|
export class SecretsManager {
|
|
92
93
|
encKey;
|
|
93
94
|
options;
|
|
95
|
+
surfaceRoot;
|
|
94
96
|
constructor(options) {
|
|
95
97
|
this.encKey = deriveEncryptionKey();
|
|
98
|
+
this.surfaceRoot = requireSurfaceRoot(options.surfaceRoot, 'SecretsManager surfaceRoot');
|
|
96
99
|
this.options = {
|
|
97
100
|
...options,
|
|
98
101
|
projectRoot: requireAbsoluteOwnedPath(options.projectRoot, 'projectRoot'),
|
|
@@ -300,14 +303,14 @@ export class SecretsManager {
|
|
|
300
303
|
for (const root of collectAncestorRoots(projectRoot)) {
|
|
301
304
|
ordered.push({
|
|
302
305
|
source: 'project-secure',
|
|
303
|
-
path: this.options.secureProjectFilePath ??
|
|
306
|
+
path: this.options.secureProjectFilePath ?? resolveSurfaceDirectory(root, this.surfaceRoot, 'secrets.enc'),
|
|
304
307
|
secure: true,
|
|
305
308
|
scope: 'project',
|
|
306
309
|
});
|
|
307
310
|
if (includePlaintext) {
|
|
308
311
|
ordered.push({
|
|
309
312
|
source: 'project-plaintext',
|
|
310
|
-
path: this.options.plaintextProjectFilePath ??
|
|
313
|
+
path: this.options.plaintextProjectFilePath ?? resolveSurfaceSharedFile(root, `${this.surfaceRoot}.secrets`, 'json'),
|
|
311
314
|
secure: false,
|
|
312
315
|
scope: 'project',
|
|
313
316
|
});
|
|
@@ -315,14 +318,14 @@ export class SecretsManager {
|
|
|
315
318
|
}
|
|
316
319
|
ordered.push({
|
|
317
320
|
source: 'user-secure',
|
|
318
|
-
path: this.options.secureUserFilePath ??
|
|
321
|
+
path: this.options.secureUserFilePath ?? resolveSurfaceDirectory(userHome, this.surfaceRoot, 'secrets.enc'),
|
|
319
322
|
secure: true,
|
|
320
323
|
scope: 'user',
|
|
321
324
|
});
|
|
322
325
|
if (includePlaintext) {
|
|
323
326
|
ordered.push({
|
|
324
327
|
source: 'user-plaintext',
|
|
325
|
-
path: this.options.plaintextUserFilePath ??
|
|
328
|
+
path: this.options.plaintextUserFilePath ?? resolveSurfaceSharedFile(userHome, `${this.surfaceRoot}.secrets`, 'json'),
|
|
326
329
|
secure: false,
|
|
327
330
|
scope: 'user',
|
|
328
331
|
});
|
|
@@ -336,26 +339,26 @@ export class SecretsManager {
|
|
|
336
339
|
for (const root of collectAncestorRoots(projectRoot)) {
|
|
337
340
|
ordered.push({
|
|
338
341
|
source: 'project-secure',
|
|
339
|
-
path: this.options.secureProjectFilePath ??
|
|
342
|
+
path: this.options.secureProjectFilePath ?? resolveSurfaceDirectory(root, this.surfaceRoot, 'secrets.enc'),
|
|
340
343
|
secure: true,
|
|
341
344
|
scope: 'project',
|
|
342
345
|
});
|
|
343
346
|
ordered.push({
|
|
344
347
|
source: 'project-plaintext',
|
|
345
|
-
path: this.options.plaintextProjectFilePath ??
|
|
348
|
+
path: this.options.plaintextProjectFilePath ?? resolveSurfaceSharedFile(root, `${this.surfaceRoot}.secrets`, 'json'),
|
|
346
349
|
secure: false,
|
|
347
350
|
scope: 'project',
|
|
348
351
|
});
|
|
349
352
|
}
|
|
350
353
|
ordered.push({
|
|
351
354
|
source: 'user-secure',
|
|
352
|
-
path: this.options.secureUserFilePath ??
|
|
355
|
+
path: this.options.secureUserFilePath ?? resolveSurfaceDirectory(userHome, this.surfaceRoot, 'secrets.enc'),
|
|
353
356
|
secure: true,
|
|
354
357
|
scope: 'user',
|
|
355
358
|
});
|
|
356
359
|
ordered.push({
|
|
357
360
|
source: 'user-plaintext',
|
|
358
|
-
path: this.options.plaintextUserFilePath ??
|
|
361
|
+
path: this.options.plaintextUserFilePath ?? resolveSurfaceSharedFile(userHome, `${this.surfaceRoot}.secrets`, 'json'),
|
|
359
362
|
secure: false,
|
|
360
363
|
scope: 'user',
|
|
361
364
|
});
|
|
@@ -367,13 +370,13 @@ export class SecretsManager {
|
|
|
367
370
|
return medium === 'secure'
|
|
368
371
|
? {
|
|
369
372
|
source: 'project-secure',
|
|
370
|
-
path: this.options.secureProjectFilePath ??
|
|
373
|
+
path: this.options.secureProjectFilePath ?? resolveSurfaceDirectory(root, this.surfaceRoot, 'secrets.enc'),
|
|
371
374
|
secure: true,
|
|
372
375
|
scope,
|
|
373
376
|
}
|
|
374
377
|
: {
|
|
375
378
|
source: 'project-plaintext',
|
|
376
|
-
path: this.options.plaintextProjectFilePath ??
|
|
379
|
+
path: this.options.plaintextProjectFilePath ?? resolveSurfaceSharedFile(root, `${this.surfaceRoot}.secrets`, 'json'),
|
|
377
380
|
secure: false,
|
|
378
381
|
scope,
|
|
379
382
|
};
|
|
@@ -382,13 +385,13 @@ export class SecretsManager {
|
|
|
382
385
|
return medium === 'secure'
|
|
383
386
|
? {
|
|
384
387
|
source: 'user-secure',
|
|
385
|
-
path: this.options.secureUserFilePath ??
|
|
388
|
+
path: this.options.secureUserFilePath ?? resolveSurfaceDirectory(userHome, this.surfaceRoot, 'secrets.enc'),
|
|
386
389
|
secure: true,
|
|
387
390
|
scope,
|
|
388
391
|
}
|
|
389
392
|
: {
|
|
390
393
|
source: 'user-plaintext',
|
|
391
|
-
path: this.options.plaintextUserFilePath ??
|
|
394
|
+
path: this.options.plaintextUserFilePath ?? resolveSurfaceSharedFile(userHome, `${this.surfaceRoot}.secrets`, 'json'),
|
|
392
395
|
secure: false,
|
|
393
396
|
scope,
|
|
394
397
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ServiceRegistry — named service credential resolution.
|
|
3
3
|
*
|
|
4
|
-
* Reads service configs from
|
|
4
|
+
* Reads service configs from the configured services.json path.
|
|
5
5
|
* Each service entry declares its authType and the SecretsManager key
|
|
6
6
|
* that holds the credential.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ServiceRegistry — named service credential resolution.
|
|
3
3
|
*
|
|
4
|
-
* Reads service configs from
|
|
4
|
+
* Reads service configs from the configured services.json path.
|
|
5
5
|
* Each service entry declares its authType and the SecretsManager key
|
|
6
6
|
* that holds the credential.
|
|
7
7
|
*
|
|
@@ -85,7 +85,7 @@ export function listAvailableSubscriptionProviders(services) {
|
|
|
85
85
|
oauth: service.oauth,
|
|
86
86
|
tokenKey: service.tokenKey,
|
|
87
87
|
providerId: provider,
|
|
88
|
-
notes: ['Configured through
|
|
88
|
+
notes: ['Configured through the host service registry services.json file'],
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
return [...providers.values()].sort((a, b) => a.provider.localeCompare(b.provider));
|
|
@@ -23,7 +23,7 @@ function readDaemonCliTokens(env) {
|
|
|
23
23
|
}
|
|
24
24
|
async function main() {
|
|
25
25
|
const { workingDirectory: workingDir, homeDirectory } = resolveDaemonCliOwnership();
|
|
26
|
-
const config = new ConfigManager({ workingDir, homeDir: homeDirectory });
|
|
26
|
+
const config = new ConfigManager({ workingDir, homeDir: homeDirectory, surfaceRoot: 'goodvibes' });
|
|
27
27
|
new GlobalNetworkTransportInstaller().install(config);
|
|
28
28
|
const runtimeBus = new RuntimeEventBus();
|
|
29
29
|
const runtimeStore = createRuntimeStore();
|