@harness-engineering/orchestrator 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +60 -6
- package/dist/index.mjs +61 -8
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1099,6 +1099,25 @@ declare class WorkspaceManager {
|
|
|
1099
1099
|
* swallowed — dispatch should not be blocked by transient network issues.
|
|
1100
1100
|
*/
|
|
1101
1101
|
private tryFetch;
|
|
1102
|
+
/**
|
|
1103
|
+
* Default paths seeded into a fresh worktree when {@link WorkspaceConfig.seedPaths}
|
|
1104
|
+
* is unset — the artifacts produced by the brainstorm → orchestrator handoff.
|
|
1105
|
+
*/
|
|
1106
|
+
private static readonly DEFAULT_SEED_PATHS;
|
|
1107
|
+
/**
|
|
1108
|
+
* Copies the configured seed paths from the root working tree into a
|
|
1109
|
+
* freshly-created worktree, overlaying the committed checkout.
|
|
1110
|
+
*
|
|
1111
|
+
* A new worktree is based on a committed remote ref, so it does not contain
|
|
1112
|
+
* uncommitted artifacts that exist only in the root working tree (a
|
|
1113
|
+
* just-written proposal under `.harness/proposals/`, a promoted row in
|
|
1114
|
+
* `docs/roadmap.md`). Seeding carries them over so a dispatched agent sees
|
|
1115
|
+
* the same state the orchestrator dispatched from.
|
|
1116
|
+
*
|
|
1117
|
+
* Best-effort by design: a missing source is skipped, and a copy failure is
|
|
1118
|
+
* swallowed — neither must ever block dispatch.
|
|
1119
|
+
*/
|
|
1120
|
+
private seedWorkspace;
|
|
1102
1121
|
/**
|
|
1103
1122
|
* Resolves the ref that new worktrees should be based on.
|
|
1104
1123
|
*
|
|
@@ -1487,6 +1506,18 @@ declare class BackendRouter {
|
|
|
1487
1506
|
private validateReferences;
|
|
1488
1507
|
}
|
|
1489
1508
|
|
|
1509
|
+
/**
|
|
1510
|
+
* Derives the worktree seed paths from a workflow config when
|
|
1511
|
+
* {@link WorkspaceConfig.seedPaths} is not set explicitly.
|
|
1512
|
+
*
|
|
1513
|
+
* A new worktree is checked out from a committed remote ref and therefore lacks
|
|
1514
|
+
* the uncommitted artifacts of the brainstorm → orchestrator handoff. Seeding
|
|
1515
|
+
* carries them over: the proposal directory, plus the roadmap file at its
|
|
1516
|
+
* *configured* location — a roadmap tracker may point `filePath` somewhere
|
|
1517
|
+
* other than the default `docs/roadmap.md`, and the default seed list would
|
|
1518
|
+
* otherwise miss it.
|
|
1519
|
+
*/
|
|
1520
|
+
declare function deriveSeedPaths(config: WorkflowConfig): string[];
|
|
1490
1521
|
/**
|
|
1491
1522
|
* The central orchestrator that manages the lifecycle of coding agents.
|
|
1492
1523
|
*
|
|
@@ -2817,4 +2848,4 @@ declare function emitProposalCreated(bus: EventEmitter, proposal: SkillProposal)
|
|
|
2817
2848
|
declare function emitProposalApproved(bus: EventEmitter, proposal: SkillProposal): void;
|
|
2818
2849
|
declare function emitProposalRejected(bus: EventEmitter, proposal: SkillProposal): void;
|
|
2819
2850
|
|
|
2820
|
-
export { type AgentUpdateEvent, AnalysisArchive, type AnalysisRecord, type ApplyEventResult, type ArtifactPresence, type AttemptStats, BUILT_IN_TASKS, BackendDefSchema, BackendRouter, type BackendRouterOptions, type BaseRefFallbackEvent, type BuildArchiveHooksOptions, ClaimManager, type ClaimManagerConfig, type CleanWorkspaceEffect, type CreateTokenInput, type CreateTokenResult, type CustomTaskValidationError, type DispatchEffect, type EmitLogEffect, type EscalateEffect, type ExecFileFn$1 as ExecFileFn, type FromConfigOptions, GateNotReadyError, type GateResult, GateRunError, type Highlight, type HighlightsInfo, type IndexedDoc, InteractionQueue, type LinearGraphQLExtension, LinearGraphQLStub, type LiveSession, LocalModelResolver, type LocalModelResolverOptions, MAX_ATTEMPTS, type MigrationResult, MockBackend, type NotificationSink, type NotificationSinkDeliverInput, ORCHESTRATOR_IDENTITY_FILE, Orchestrator, OrchestratorBackendFactory, type OrchestratorBackendFactoryOptions, type OrchestratorContext, type OrchestratorEvent, type OrchestratorState, PRDetector, type PRDetectorLogger, type PendingInteraction, type PersistedOutputEntry, PromotionError, type PromotionResult, PromptRenderer, type ProposalApprovedData, type ProposalCreatedData, type ProposalRejectedData, type PublishedIndex, type QueueInsertInput, type QueueRow, type QueueStats, RETRY_DELAYS_MS, type RateLimitSnapshot as RateLimitComputeSnapshot, type RateLimitConfig, type RateLimitSnapshot$1 as RateLimitSnapshot, type RegistryEntry, type ReleaseClaimEffect, type ResolverLogger, type RetryEntry, type RetryFiredEvent, RoadmapTrackerAdapter, RoutingConfigSchema, RoutingValueSchema, type RunAttemptPhase, type RunOrigin, type RunningEntry, type ScheduleRetryEffect, type SearchOptions, type SideEffect, SinkConfigError, SinkRegistry, type SkillCatalogEntry, SlackSink, type SlackSinkOptions, SqliteSearchIndex, type StallDetectedEvent, type StopEffect, type StreamManifest, StreamRecorder, type SummarizeContext, type SummarizeResult, type SyncMainOptions, type SyncMainResult, type SyncSkipReason, type TaskDefinition, TaskOutputStore, type TaskType, type TickEvent, TokenStore, type TokenTotals, type TriageConfig, type TriageDecision, type TriageSignals, type TriageSkill, type UpdateTokensEffect, type ValidateWorkflowConfigOptions, type ValidatedWorkflowConfig, WebhookQueue, type WorkerExitEvent, WorkflowLoader, WorkspaceHooks, WorkspaceManager, type WorkspaceManagerOptions, applyEvent, artifactPresenceFromIssue, buildArchiveHooks, calculateRetryDelay, canDispatch, computeRateLimitDelay, createBackend, createEmptyState, crossFieldRoutingIssues, defaultFetchModels, detectScopeTier, discoverSkillCatalog, discoverSkillCatalogNames, emitProposalApproved, emitProposalCreated, emitProposalRejected, extractHighlights, extractTitlePrefix, getAvailableSlots, getDefaultConfig, getPerStateCount, indexSessionDirectory, isEligible, isSummaryEnabled, launchTUI, loadPublishedIndex, migrateAgentConfig, normalizeFts5Query, normalizeLocalModel, openSearchIndex, promote, reconcile, reindexFromArchive, renderAnalysisComment, renderLlmSummaryMarkdown, renderPRComment, resolveEscalationConfig, resolveOrchestratorId, routeIssue, routingWarnings, runGate, savePublishedIndex, searchIndexPath, selectCandidates, sortCandidates, summarizeArchivedSession, syncMain, triageIssue, truncateForBudget, validateCustomTasks, validateWorkflowConfig, wireNotificationSinks, wrapAsEnvelope };
|
|
2851
|
+
export { type AgentUpdateEvent, AnalysisArchive, type AnalysisRecord, type ApplyEventResult, type ArtifactPresence, type AttemptStats, BUILT_IN_TASKS, BackendDefSchema, BackendRouter, type BackendRouterOptions, type BaseRefFallbackEvent, type BuildArchiveHooksOptions, ClaimManager, type ClaimManagerConfig, type CleanWorkspaceEffect, type CreateTokenInput, type CreateTokenResult, type CustomTaskValidationError, type DispatchEffect, type EmitLogEffect, type EscalateEffect, type ExecFileFn$1 as ExecFileFn, type FromConfigOptions, GateNotReadyError, type GateResult, GateRunError, type Highlight, type HighlightsInfo, type IndexedDoc, InteractionQueue, type LinearGraphQLExtension, LinearGraphQLStub, type LiveSession, LocalModelResolver, type LocalModelResolverOptions, MAX_ATTEMPTS, type MigrationResult, MockBackend, type NotificationSink, type NotificationSinkDeliverInput, ORCHESTRATOR_IDENTITY_FILE, Orchestrator, OrchestratorBackendFactory, type OrchestratorBackendFactoryOptions, type OrchestratorContext, type OrchestratorEvent, type OrchestratorState, PRDetector, type PRDetectorLogger, type PendingInteraction, type PersistedOutputEntry, PromotionError, type PromotionResult, PromptRenderer, type ProposalApprovedData, type ProposalCreatedData, type ProposalRejectedData, type PublishedIndex, type QueueInsertInput, type QueueRow, type QueueStats, RETRY_DELAYS_MS, type RateLimitSnapshot as RateLimitComputeSnapshot, type RateLimitConfig, type RateLimitSnapshot$1 as RateLimitSnapshot, type RegistryEntry, type ReleaseClaimEffect, type ResolverLogger, type RetryEntry, type RetryFiredEvent, RoadmapTrackerAdapter, RoutingConfigSchema, RoutingValueSchema, type RunAttemptPhase, type RunOrigin, type RunningEntry, type ScheduleRetryEffect, type SearchOptions, type SideEffect, SinkConfigError, SinkRegistry, type SkillCatalogEntry, SlackSink, type SlackSinkOptions, SqliteSearchIndex, type StallDetectedEvent, type StopEffect, type StreamManifest, StreamRecorder, type SummarizeContext, type SummarizeResult, type SyncMainOptions, type SyncMainResult, type SyncSkipReason, type TaskDefinition, TaskOutputStore, type TaskType, type TickEvent, TokenStore, type TokenTotals, type TriageConfig, type TriageDecision, type TriageSignals, type TriageSkill, type UpdateTokensEffect, type ValidateWorkflowConfigOptions, type ValidatedWorkflowConfig, WebhookQueue, type WorkerExitEvent, WorkflowLoader, WorkspaceHooks, WorkspaceManager, type WorkspaceManagerOptions, applyEvent, artifactPresenceFromIssue, buildArchiveHooks, calculateRetryDelay, canDispatch, computeRateLimitDelay, createBackend, createEmptyState, crossFieldRoutingIssues, defaultFetchModels, deriveSeedPaths, detectScopeTier, discoverSkillCatalog, discoverSkillCatalogNames, emitProposalApproved, emitProposalCreated, emitProposalRejected, extractHighlights, extractTitlePrefix, getAvailableSlots, getDefaultConfig, getPerStateCount, indexSessionDirectory, isEligible, isSummaryEnabled, launchTUI, loadPublishedIndex, migrateAgentConfig, normalizeFts5Query, normalizeLocalModel, openSearchIndex, promote, reconcile, reindexFromArchive, renderAnalysisComment, renderLlmSummaryMarkdown, renderPRComment, resolveEscalationConfig, resolveOrchestratorId, routeIssue, routingWarnings, runGate, savePublishedIndex, searchIndexPath, selectCandidates, sortCandidates, summarizeArchivedSession, syncMain, triageIssue, truncateForBudget, validateCustomTasks, validateWorkflowConfig, wireNotificationSinks, wrapAsEnvelope };
|
package/dist/index.d.ts
CHANGED
|
@@ -1099,6 +1099,25 @@ declare class WorkspaceManager {
|
|
|
1099
1099
|
* swallowed — dispatch should not be blocked by transient network issues.
|
|
1100
1100
|
*/
|
|
1101
1101
|
private tryFetch;
|
|
1102
|
+
/**
|
|
1103
|
+
* Default paths seeded into a fresh worktree when {@link WorkspaceConfig.seedPaths}
|
|
1104
|
+
* is unset — the artifacts produced by the brainstorm → orchestrator handoff.
|
|
1105
|
+
*/
|
|
1106
|
+
private static readonly DEFAULT_SEED_PATHS;
|
|
1107
|
+
/**
|
|
1108
|
+
* Copies the configured seed paths from the root working tree into a
|
|
1109
|
+
* freshly-created worktree, overlaying the committed checkout.
|
|
1110
|
+
*
|
|
1111
|
+
* A new worktree is based on a committed remote ref, so it does not contain
|
|
1112
|
+
* uncommitted artifacts that exist only in the root working tree (a
|
|
1113
|
+
* just-written proposal under `.harness/proposals/`, a promoted row in
|
|
1114
|
+
* `docs/roadmap.md`). Seeding carries them over so a dispatched agent sees
|
|
1115
|
+
* the same state the orchestrator dispatched from.
|
|
1116
|
+
*
|
|
1117
|
+
* Best-effort by design: a missing source is skipped, and a copy failure is
|
|
1118
|
+
* swallowed — neither must ever block dispatch.
|
|
1119
|
+
*/
|
|
1120
|
+
private seedWorkspace;
|
|
1102
1121
|
/**
|
|
1103
1122
|
* Resolves the ref that new worktrees should be based on.
|
|
1104
1123
|
*
|
|
@@ -1487,6 +1506,18 @@ declare class BackendRouter {
|
|
|
1487
1506
|
private validateReferences;
|
|
1488
1507
|
}
|
|
1489
1508
|
|
|
1509
|
+
/**
|
|
1510
|
+
* Derives the worktree seed paths from a workflow config when
|
|
1511
|
+
* {@link WorkspaceConfig.seedPaths} is not set explicitly.
|
|
1512
|
+
*
|
|
1513
|
+
* A new worktree is checked out from a committed remote ref and therefore lacks
|
|
1514
|
+
* the uncommitted artifacts of the brainstorm → orchestrator handoff. Seeding
|
|
1515
|
+
* carries them over: the proposal directory, plus the roadmap file at its
|
|
1516
|
+
* *configured* location — a roadmap tracker may point `filePath` somewhere
|
|
1517
|
+
* other than the default `docs/roadmap.md`, and the default seed list would
|
|
1518
|
+
* otherwise miss it.
|
|
1519
|
+
*/
|
|
1520
|
+
declare function deriveSeedPaths(config: WorkflowConfig): string[];
|
|
1490
1521
|
/**
|
|
1491
1522
|
* The central orchestrator that manages the lifecycle of coding agents.
|
|
1492
1523
|
*
|
|
@@ -2817,4 +2848,4 @@ declare function emitProposalCreated(bus: EventEmitter, proposal: SkillProposal)
|
|
|
2817
2848
|
declare function emitProposalApproved(bus: EventEmitter, proposal: SkillProposal): void;
|
|
2818
2849
|
declare function emitProposalRejected(bus: EventEmitter, proposal: SkillProposal): void;
|
|
2819
2850
|
|
|
2820
|
-
export { type AgentUpdateEvent, AnalysisArchive, type AnalysisRecord, type ApplyEventResult, type ArtifactPresence, type AttemptStats, BUILT_IN_TASKS, BackendDefSchema, BackendRouter, type BackendRouterOptions, type BaseRefFallbackEvent, type BuildArchiveHooksOptions, ClaimManager, type ClaimManagerConfig, type CleanWorkspaceEffect, type CreateTokenInput, type CreateTokenResult, type CustomTaskValidationError, type DispatchEffect, type EmitLogEffect, type EscalateEffect, type ExecFileFn$1 as ExecFileFn, type FromConfigOptions, GateNotReadyError, type GateResult, GateRunError, type Highlight, type HighlightsInfo, type IndexedDoc, InteractionQueue, type LinearGraphQLExtension, LinearGraphQLStub, type LiveSession, LocalModelResolver, type LocalModelResolverOptions, MAX_ATTEMPTS, type MigrationResult, MockBackend, type NotificationSink, type NotificationSinkDeliverInput, ORCHESTRATOR_IDENTITY_FILE, Orchestrator, OrchestratorBackendFactory, type OrchestratorBackendFactoryOptions, type OrchestratorContext, type OrchestratorEvent, type OrchestratorState, PRDetector, type PRDetectorLogger, type PendingInteraction, type PersistedOutputEntry, PromotionError, type PromotionResult, PromptRenderer, type ProposalApprovedData, type ProposalCreatedData, type ProposalRejectedData, type PublishedIndex, type QueueInsertInput, type QueueRow, type QueueStats, RETRY_DELAYS_MS, type RateLimitSnapshot as RateLimitComputeSnapshot, type RateLimitConfig, type RateLimitSnapshot$1 as RateLimitSnapshot, type RegistryEntry, type ReleaseClaimEffect, type ResolverLogger, type RetryEntry, type RetryFiredEvent, RoadmapTrackerAdapter, RoutingConfigSchema, RoutingValueSchema, type RunAttemptPhase, type RunOrigin, type RunningEntry, type ScheduleRetryEffect, type SearchOptions, type SideEffect, SinkConfigError, SinkRegistry, type SkillCatalogEntry, SlackSink, type SlackSinkOptions, SqliteSearchIndex, type StallDetectedEvent, type StopEffect, type StreamManifest, StreamRecorder, type SummarizeContext, type SummarizeResult, type SyncMainOptions, type SyncMainResult, type SyncSkipReason, type TaskDefinition, TaskOutputStore, type TaskType, type TickEvent, TokenStore, type TokenTotals, type TriageConfig, type TriageDecision, type TriageSignals, type TriageSkill, type UpdateTokensEffect, type ValidateWorkflowConfigOptions, type ValidatedWorkflowConfig, WebhookQueue, type WorkerExitEvent, WorkflowLoader, WorkspaceHooks, WorkspaceManager, type WorkspaceManagerOptions, applyEvent, artifactPresenceFromIssue, buildArchiveHooks, calculateRetryDelay, canDispatch, computeRateLimitDelay, createBackend, createEmptyState, crossFieldRoutingIssues, defaultFetchModels, detectScopeTier, discoverSkillCatalog, discoverSkillCatalogNames, emitProposalApproved, emitProposalCreated, emitProposalRejected, extractHighlights, extractTitlePrefix, getAvailableSlots, getDefaultConfig, getPerStateCount, indexSessionDirectory, isEligible, isSummaryEnabled, launchTUI, loadPublishedIndex, migrateAgentConfig, normalizeFts5Query, normalizeLocalModel, openSearchIndex, promote, reconcile, reindexFromArchive, renderAnalysisComment, renderLlmSummaryMarkdown, renderPRComment, resolveEscalationConfig, resolveOrchestratorId, routeIssue, routingWarnings, runGate, savePublishedIndex, searchIndexPath, selectCandidates, sortCandidates, summarizeArchivedSession, syncMain, triageIssue, truncateForBudget, validateCustomTasks, validateWorkflowConfig, wireNotificationSinks, wrapAsEnvelope };
|
|
2851
|
+
export { type AgentUpdateEvent, AnalysisArchive, type AnalysisRecord, type ApplyEventResult, type ArtifactPresence, type AttemptStats, BUILT_IN_TASKS, BackendDefSchema, BackendRouter, type BackendRouterOptions, type BaseRefFallbackEvent, type BuildArchiveHooksOptions, ClaimManager, type ClaimManagerConfig, type CleanWorkspaceEffect, type CreateTokenInput, type CreateTokenResult, type CustomTaskValidationError, type DispatchEffect, type EmitLogEffect, type EscalateEffect, type ExecFileFn$1 as ExecFileFn, type FromConfigOptions, GateNotReadyError, type GateResult, GateRunError, type Highlight, type HighlightsInfo, type IndexedDoc, InteractionQueue, type LinearGraphQLExtension, LinearGraphQLStub, type LiveSession, LocalModelResolver, type LocalModelResolverOptions, MAX_ATTEMPTS, type MigrationResult, MockBackend, type NotificationSink, type NotificationSinkDeliverInput, ORCHESTRATOR_IDENTITY_FILE, Orchestrator, OrchestratorBackendFactory, type OrchestratorBackendFactoryOptions, type OrchestratorContext, type OrchestratorEvent, type OrchestratorState, PRDetector, type PRDetectorLogger, type PendingInteraction, type PersistedOutputEntry, PromotionError, type PromotionResult, PromptRenderer, type ProposalApprovedData, type ProposalCreatedData, type ProposalRejectedData, type PublishedIndex, type QueueInsertInput, type QueueRow, type QueueStats, RETRY_DELAYS_MS, type RateLimitSnapshot as RateLimitComputeSnapshot, type RateLimitConfig, type RateLimitSnapshot$1 as RateLimitSnapshot, type RegistryEntry, type ReleaseClaimEffect, type ResolverLogger, type RetryEntry, type RetryFiredEvent, RoadmapTrackerAdapter, RoutingConfigSchema, RoutingValueSchema, type RunAttemptPhase, type RunOrigin, type RunningEntry, type ScheduleRetryEffect, type SearchOptions, type SideEffect, SinkConfigError, SinkRegistry, type SkillCatalogEntry, SlackSink, type SlackSinkOptions, SqliteSearchIndex, type StallDetectedEvent, type StopEffect, type StreamManifest, StreamRecorder, type SummarizeContext, type SummarizeResult, type SyncMainOptions, type SyncMainResult, type SyncSkipReason, type TaskDefinition, TaskOutputStore, type TaskType, type TickEvent, TokenStore, type TokenTotals, type TriageConfig, type TriageDecision, type TriageSignals, type TriageSkill, type UpdateTokensEffect, type ValidateWorkflowConfigOptions, type ValidatedWorkflowConfig, WebhookQueue, type WorkerExitEvent, WorkflowLoader, WorkspaceHooks, WorkspaceManager, type WorkspaceManagerOptions, applyEvent, artifactPresenceFromIssue, buildArchiveHooks, calculateRetryDelay, canDispatch, computeRateLimitDelay, createBackend, createEmptyState, crossFieldRoutingIssues, defaultFetchModels, deriveSeedPaths, detectScopeTier, discoverSkillCatalog, discoverSkillCatalogNames, emitProposalApproved, emitProposalCreated, emitProposalRejected, extractHighlights, extractTitlePrefix, getAvailableSlots, getDefaultConfig, getPerStateCount, indexSessionDirectory, isEligible, isSummaryEnabled, launchTUI, loadPublishedIndex, migrateAgentConfig, normalizeFts5Query, normalizeLocalModel, openSearchIndex, promote, reconcile, reindexFromArchive, renderAnalysisComment, renderLlmSummaryMarkdown, renderPRComment, resolveEscalationConfig, resolveOrchestratorId, routeIssue, routingWarnings, runGate, savePublishedIndex, searchIndexPath, selectCandidates, sortCandidates, summarizeArchivedSession, syncMain, triageIssue, truncateForBudget, validateCustomTasks, validateWorkflowConfig, wireNotificationSinks, wrapAsEnvelope };
|
package/dist/index.js
CHANGED
|
@@ -73,6 +73,7 @@ __export(index_exports, {
|
|
|
73
73
|
createEmptyState: () => createEmptyState,
|
|
74
74
|
crossFieldRoutingIssues: () => crossFieldRoutingIssues,
|
|
75
75
|
defaultFetchModels: () => defaultFetchModels,
|
|
76
|
+
deriveSeedPaths: () => deriveSeedPaths,
|
|
76
77
|
detectScopeTier: () => detectScopeTier,
|
|
77
78
|
discoverSkillCatalog: () => discoverSkillCatalog,
|
|
78
79
|
discoverSkillCatalogNames: () => discoverSkillCatalogNames,
|
|
@@ -2459,7 +2460,7 @@ var path8 = __toESM(require("path"));
|
|
|
2459
2460
|
var import_node_child_process2 = require("child_process");
|
|
2460
2461
|
var import_node_util2 = require("util");
|
|
2461
2462
|
var import_types6 = require("@harness-engineering/types");
|
|
2462
|
-
var WorkspaceManager = class {
|
|
2463
|
+
var WorkspaceManager = class _WorkspaceManager {
|
|
2463
2464
|
config;
|
|
2464
2465
|
/** Absolute path to the git repository root (resolved lazily). */
|
|
2465
2466
|
repoRoot = null;
|
|
@@ -2530,6 +2531,7 @@ var WorkspaceManager = class {
|
|
|
2530
2531
|
await this.tryFetch(repoRoot);
|
|
2531
2532
|
const baseRef = await this.resolveBaseRef(repoRoot);
|
|
2532
2533
|
await this.git(["worktree", "add", "--detach", workspacePath, baseRef], repoRoot);
|
|
2534
|
+
await this.seedWorkspace(workspacePath, repoRoot);
|
|
2533
2535
|
return (0, import_types6.Ok)(workspacePath);
|
|
2534
2536
|
} catch (error) {
|
|
2535
2537
|
return (0, import_types6.Err)(error instanceof Error ? error : new Error(String(error)));
|
|
@@ -2546,6 +2548,44 @@ var WorkspaceManager = class {
|
|
|
2546
2548
|
} catch {
|
|
2547
2549
|
}
|
|
2548
2550
|
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Default paths seeded into a fresh worktree when {@link WorkspaceConfig.seedPaths}
|
|
2553
|
+
* is unset — the artifacts produced by the brainstorm → orchestrator handoff.
|
|
2554
|
+
*/
|
|
2555
|
+
static DEFAULT_SEED_PATHS = [".harness/proposals", "docs/roadmap.md"];
|
|
2556
|
+
/**
|
|
2557
|
+
* Copies the configured seed paths from the root working tree into a
|
|
2558
|
+
* freshly-created worktree, overlaying the committed checkout.
|
|
2559
|
+
*
|
|
2560
|
+
* A new worktree is based on a committed remote ref, so it does not contain
|
|
2561
|
+
* uncommitted artifacts that exist only in the root working tree (a
|
|
2562
|
+
* just-written proposal under `.harness/proposals/`, a promoted row in
|
|
2563
|
+
* `docs/roadmap.md`). Seeding carries them over so a dispatched agent sees
|
|
2564
|
+
* the same state the orchestrator dispatched from.
|
|
2565
|
+
*
|
|
2566
|
+
* Best-effort by design: a missing source is skipped, and a copy failure is
|
|
2567
|
+
* swallowed — neither must ever block dispatch.
|
|
2568
|
+
*/
|
|
2569
|
+
async seedWorkspace(workspacePath, repoRoot) {
|
|
2570
|
+
const seedPaths = this.config.seedPaths ?? _WorkspaceManager.DEFAULT_SEED_PATHS;
|
|
2571
|
+
for (const entry of seedPaths) {
|
|
2572
|
+
const rel = path8.isAbsolute(entry) ? path8.relative(repoRoot, entry).replaceAll("\\", "/") : entry;
|
|
2573
|
+
if (!rel || rel === ".." || rel.startsWith("../") || path8.isAbsolute(rel)) {
|
|
2574
|
+
continue;
|
|
2575
|
+
}
|
|
2576
|
+
const src = path8.join(repoRoot, rel);
|
|
2577
|
+
try {
|
|
2578
|
+
await fs9.access(src);
|
|
2579
|
+
} catch {
|
|
2580
|
+
continue;
|
|
2581
|
+
}
|
|
2582
|
+
const dest = path8.join(workspacePath, rel);
|
|
2583
|
+
try {
|
|
2584
|
+
await fs9.cp(src, dest, { recursive: true, force: true });
|
|
2585
|
+
} catch {
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2549
2589
|
/**
|
|
2550
2590
|
* Resolves the ref that new worktrees should be based on.
|
|
2551
2591
|
*
|
|
@@ -12440,6 +12480,10 @@ function reportCycle(path24, next, errors, reported) {
|
|
|
12440
12480
|
}
|
|
12441
12481
|
|
|
12442
12482
|
// src/orchestrator.ts
|
|
12483
|
+
function deriveSeedPaths(config) {
|
|
12484
|
+
const roadmapPath = config.tracker.kind === "roadmap" && config.tracker.filePath ? config.tracker.filePath : "docs/roadmap.md";
|
|
12485
|
+
return [".harness/proposals", roadmapPath];
|
|
12486
|
+
}
|
|
12443
12487
|
var Orchestrator = class extends import_node_events.EventEmitter {
|
|
12444
12488
|
state;
|
|
12445
12489
|
config;
|
|
@@ -12603,12 +12647,21 @@ var Orchestrator = class extends import_node_events.EventEmitter {
|
|
|
12603
12647
|
);
|
|
12604
12648
|
}
|
|
12605
12649
|
this.tracker = overrides?.tracker || this.createTracker();
|
|
12606
|
-
this.workspace = new WorkspaceManager(
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
12650
|
+
this.workspace = new WorkspaceManager(
|
|
12651
|
+
{
|
|
12652
|
+
...config.workspace,
|
|
12653
|
+
// Seed the brainstorm handoff artifacts into each fresh worktree. An
|
|
12654
|
+
// explicit `seedPaths` wins; otherwise derive from the tracker config
|
|
12655
|
+
// so a non-default roadmap location is still carried over.
|
|
12656
|
+
seedPaths: config.workspace.seedPaths ?? deriveSeedPaths(config)
|
|
12657
|
+
},
|
|
12658
|
+
{
|
|
12659
|
+
emitEvent: (event) => {
|
|
12660
|
+
this.server?.broadcastMaintenance("maintenance:baseref_fallback", event);
|
|
12661
|
+
this.emit("maintenance:baseref_fallback", event);
|
|
12662
|
+
}
|
|
12610
12663
|
}
|
|
12611
|
-
|
|
12664
|
+
);
|
|
12612
12665
|
this.hooks = new WorkspaceHooks(config.hooks);
|
|
12613
12666
|
this.renderer = new PromptRenderer();
|
|
12614
12667
|
this.overrideBackend = overrides?.backend ?? null;
|
|
@@ -14770,6 +14823,7 @@ function buildArchiveHooks(opts) {
|
|
|
14770
14823
|
createEmptyState,
|
|
14771
14824
|
crossFieldRoutingIssues,
|
|
14772
14825
|
defaultFetchModels,
|
|
14826
|
+
deriveSeedPaths,
|
|
14773
14827
|
detectScopeTier,
|
|
14774
14828
|
discoverSkillCatalog,
|
|
14775
14829
|
discoverSkillCatalogNames,
|
package/dist/index.mjs
CHANGED
|
@@ -2348,7 +2348,7 @@ import * as path8 from "path";
|
|
|
2348
2348
|
import { execFile as execFile2 } from "child_process";
|
|
2349
2349
|
import { promisify as promisify2 } from "util";
|
|
2350
2350
|
import { Ok as Ok6, Err as Err4 } from "@harness-engineering/types";
|
|
2351
|
-
var WorkspaceManager = class {
|
|
2351
|
+
var WorkspaceManager = class _WorkspaceManager {
|
|
2352
2352
|
config;
|
|
2353
2353
|
/** Absolute path to the git repository root (resolved lazily). */
|
|
2354
2354
|
repoRoot = null;
|
|
@@ -2419,6 +2419,7 @@ var WorkspaceManager = class {
|
|
|
2419
2419
|
await this.tryFetch(repoRoot);
|
|
2420
2420
|
const baseRef = await this.resolveBaseRef(repoRoot);
|
|
2421
2421
|
await this.git(["worktree", "add", "--detach", workspacePath, baseRef], repoRoot);
|
|
2422
|
+
await this.seedWorkspace(workspacePath, repoRoot);
|
|
2422
2423
|
return Ok6(workspacePath);
|
|
2423
2424
|
} catch (error) {
|
|
2424
2425
|
return Err4(error instanceof Error ? error : new Error(String(error)));
|
|
@@ -2435,6 +2436,44 @@ var WorkspaceManager = class {
|
|
|
2435
2436
|
} catch {
|
|
2436
2437
|
}
|
|
2437
2438
|
}
|
|
2439
|
+
/**
|
|
2440
|
+
* Default paths seeded into a fresh worktree when {@link WorkspaceConfig.seedPaths}
|
|
2441
|
+
* is unset — the artifacts produced by the brainstorm → orchestrator handoff.
|
|
2442
|
+
*/
|
|
2443
|
+
static DEFAULT_SEED_PATHS = [".harness/proposals", "docs/roadmap.md"];
|
|
2444
|
+
/**
|
|
2445
|
+
* Copies the configured seed paths from the root working tree into a
|
|
2446
|
+
* freshly-created worktree, overlaying the committed checkout.
|
|
2447
|
+
*
|
|
2448
|
+
* A new worktree is based on a committed remote ref, so it does not contain
|
|
2449
|
+
* uncommitted artifacts that exist only in the root working tree (a
|
|
2450
|
+
* just-written proposal under `.harness/proposals/`, a promoted row in
|
|
2451
|
+
* `docs/roadmap.md`). Seeding carries them over so a dispatched agent sees
|
|
2452
|
+
* the same state the orchestrator dispatched from.
|
|
2453
|
+
*
|
|
2454
|
+
* Best-effort by design: a missing source is skipped, and a copy failure is
|
|
2455
|
+
* swallowed — neither must ever block dispatch.
|
|
2456
|
+
*/
|
|
2457
|
+
async seedWorkspace(workspacePath, repoRoot) {
|
|
2458
|
+
const seedPaths = this.config.seedPaths ?? _WorkspaceManager.DEFAULT_SEED_PATHS;
|
|
2459
|
+
for (const entry of seedPaths) {
|
|
2460
|
+
const rel = path8.isAbsolute(entry) ? path8.relative(repoRoot, entry).replaceAll("\\", "/") : entry;
|
|
2461
|
+
if (!rel || rel === ".." || rel.startsWith("../") || path8.isAbsolute(rel)) {
|
|
2462
|
+
continue;
|
|
2463
|
+
}
|
|
2464
|
+
const src = path8.join(repoRoot, rel);
|
|
2465
|
+
try {
|
|
2466
|
+
await fs9.access(src);
|
|
2467
|
+
} catch {
|
|
2468
|
+
continue;
|
|
2469
|
+
}
|
|
2470
|
+
const dest = path8.join(workspacePath, rel);
|
|
2471
|
+
try {
|
|
2472
|
+
await fs9.cp(src, dest, { recursive: true, force: true });
|
|
2473
|
+
} catch {
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2438
2477
|
/**
|
|
2439
2478
|
* Resolves the ref that new worktrees should be based on.
|
|
2440
2479
|
*
|
|
@@ -10738,7 +10777,7 @@ var StructuredLogger = class {
|
|
|
10738
10777
|
|
|
10739
10778
|
// src/workspace/config-scanner.ts
|
|
10740
10779
|
import { existsSync as existsSync6, readFileSync as readFileSync6 } from "fs";
|
|
10741
|
-
import { join as join15, relative } from "path";
|
|
10780
|
+
import { join as join15, relative as relative2 } from "path";
|
|
10742
10781
|
import {
|
|
10743
10782
|
scanForInjection,
|
|
10744
10783
|
SecurityScanner,
|
|
@@ -10775,7 +10814,7 @@ async function scanSingleFile(filePath, targetDir, scanner) {
|
|
|
10775
10814
|
findings.push(...mapSecurityFindings(secFindings, findings));
|
|
10776
10815
|
const adjusted = adjustFindingSeverity(findings);
|
|
10777
10816
|
return {
|
|
10778
|
-
file:
|
|
10817
|
+
file: relative2(targetDir, filePath).replaceAll("\\", "/"),
|
|
10779
10818
|
findings: adjusted,
|
|
10780
10819
|
overallSeverity: computeOverallSeverity(adjusted)
|
|
10781
10820
|
};
|
|
@@ -12411,6 +12450,10 @@ function reportCycle(path24, next, errors, reported) {
|
|
|
12411
12450
|
}
|
|
12412
12451
|
|
|
12413
12452
|
// src/orchestrator.ts
|
|
12453
|
+
function deriveSeedPaths(config) {
|
|
12454
|
+
const roadmapPath = config.tracker.kind === "roadmap" && config.tracker.filePath ? config.tracker.filePath : "docs/roadmap.md";
|
|
12455
|
+
return [".harness/proposals", roadmapPath];
|
|
12456
|
+
}
|
|
12414
12457
|
var Orchestrator = class extends EventEmitter {
|
|
12415
12458
|
state;
|
|
12416
12459
|
config;
|
|
@@ -12574,12 +12617,21 @@ var Orchestrator = class extends EventEmitter {
|
|
|
12574
12617
|
);
|
|
12575
12618
|
}
|
|
12576
12619
|
this.tracker = overrides?.tracker || this.createTracker();
|
|
12577
|
-
this.workspace = new WorkspaceManager(
|
|
12578
|
-
|
|
12579
|
-
|
|
12580
|
-
|
|
12620
|
+
this.workspace = new WorkspaceManager(
|
|
12621
|
+
{
|
|
12622
|
+
...config.workspace,
|
|
12623
|
+
// Seed the brainstorm handoff artifacts into each fresh worktree. An
|
|
12624
|
+
// explicit `seedPaths` wins; otherwise derive from the tracker config
|
|
12625
|
+
// so a non-default roadmap location is still carried over.
|
|
12626
|
+
seedPaths: config.workspace.seedPaths ?? deriveSeedPaths(config)
|
|
12627
|
+
},
|
|
12628
|
+
{
|
|
12629
|
+
emitEvent: (event) => {
|
|
12630
|
+
this.server?.broadcastMaintenance("maintenance:baseref_fallback", event);
|
|
12631
|
+
this.emit("maintenance:baseref_fallback", event);
|
|
12632
|
+
}
|
|
12581
12633
|
}
|
|
12582
|
-
|
|
12634
|
+
);
|
|
12583
12635
|
this.hooks = new WorkspaceHooks(config.hooks);
|
|
12584
12636
|
this.renderer = new PromptRenderer();
|
|
12585
12637
|
this.overrideBackend = overrides?.backend ?? null;
|
|
@@ -14742,6 +14794,7 @@ export {
|
|
|
14742
14794
|
createEmptyState,
|
|
14743
14795
|
crossFieldRoutingIssues,
|
|
14744
14796
|
defaultFetchModels,
|
|
14797
|
+
deriveSeedPaths,
|
|
14745
14798
|
detectScopeTier,
|
|
14746
14799
|
discoverSkillCatalog,
|
|
14747
14800
|
discoverSkillCatalogNames,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harness-engineering/orchestrator",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Orchestrator daemon for dispatching coding agents to issues",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"ws": "^8.21.0",
|
|
49
49
|
"yaml": "^2.8.3",
|
|
50
50
|
"zod": "^3.25.76",
|
|
51
|
-
"@harness-engineering/core": "0.30.
|
|
52
|
-
"@harness-engineering/graph": "0.11.
|
|
53
|
-
"@harness-engineering/
|
|
54
|
-
"@harness-engineering/
|
|
51
|
+
"@harness-engineering/core": "0.30.1",
|
|
52
|
+
"@harness-engineering/graph": "0.11.1",
|
|
53
|
+
"@harness-engineering/types": "0.16.1",
|
|
54
|
+
"@harness-engineering/intelligence": "0.3.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@asteasolutions/zod-to-openapi": "^7.3.0",
|