Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
"maxLines": 2700,
"followUp": "M1 shared boundary split"
},
"packages/daemon/src/lib/space/workflows/built-in-workflows.ts": {
"maxLines": 2272,
"followUp": "M9 space service extraction"
},
"packages/daemon/src/lib/space/runtime/space-runtime-service.ts": {
"maxLines": 2067,
"followUp": "M9 runtime component extraction"
Expand All @@ -51,8 +47,8 @@
"maxLines": 1817,
"followUp": "M8/UI focused view split"
},
"packages/daemon/src/lib/space/runtime/workflow-hook-engine.ts": {
"maxLines": 1687,
"packages/daemon/src/lib/workflows/hook-engine.ts": {
"maxLines": 635,
"followUp": "M9 runtime component extraction"
},
"packages/daemon/src/storage/repositories/sdk-message-repository.ts": {
Expand Down Expand Up @@ -239,10 +235,6 @@
"maxLines": 847,
"followUp": "M9 space service extraction"
},
"packages/daemon/src/lib/space/managers/space-workflow-manager.ts": {
"maxLines": 845,
"followUp": "M9 space service extraction"
},
"packages/daemon/src/lib/agent/query-lifecycle-manager.ts": {
"maxLines": 833,
"followUp": "M7 agent runtime boundary split"
Expand Down
11 changes: 6 additions & 5 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@
"packages/daemon/src/lib/agents/seed-agents.ts": ["exports"],
"packages/daemon/src/lib/model-settlement-routing.ts": ["exports"],
"packages/daemon/src/lib/space/artifact-git-ops.ts": ["exports"],
"packages/daemon/src/lib/space/managers/node-execution-manager.ts": ["exports"],
"packages/daemon/src/lib/messaging/space-adapter.ts": ["exports"],
"packages/daemon/src/lib/workflows/node-execution-manager.ts": ["exports"],
"packages/daemon/src/lib/space/runtime/gate-evaluator.ts": ["exports"],
"packages/daemon/src/lib/workflows/post-approval-route-selection.ts": ["exports"],
"packages/daemon/src/lib/workflows/built-in-validator-registry.ts": ["exports"],
"packages/daemon/src/lib/workflows/template-hash.ts": ["exports"],
"packages/daemon/src/lib/messaging/space-adapter.ts": ["exports"],
"packages/daemon/src/lib/messaging/injection-delivery-steps.ts": ["exports"],
"packages/daemon/src/lib/messaging/render-pending-digest-pipeline.ts": ["exports"],
"packages/daemon/src/lib/space/runtime/post-approval-router.ts": ["exports"],
"packages/daemon/src/lib/space/runtime/built-in-validator-registry.ts": ["exports"],
"packages/daemon/src/lib/workflows/post-approval-router.ts": ["exports"],
"packages/daemon/src/lib/utils/retry-utils.ts": ["exports"],
"packages/daemon/src/lib/space/workflows/template-hash.ts": ["exports"],
"packages/daemon/src/storage/index.ts": ["exports"],
"packages/daemon/src/storage/schema/index.ts": ["exports"],
"packages/daemon/src/storage/repositories/goal-repository.ts": ["exports"],
Expand Down
8 changes: 4 additions & 4 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const config: KnipConfig = {
'packages/daemon/src/lib/agents/custom-agent.ts': ['exports'],
'packages/daemon/src/lib/agents/seed-agents.ts': ['exports'],
'packages/daemon/src/lib/space/artifact-git-ops.ts': ['exports'],
'packages/daemon/src/lib/space/managers/node-execution-manager.ts': ['exports'],
'packages/daemon/src/lib/workflows/node-execution-manager.ts': ['exports'],
'packages/daemon/src/lib/mailbox/bridge.ts': ['exports'],
'packages/daemon/src/lib/mailbox/deferred-replay-scheduler.ts': ['exports'],
'packages/daemon/src/lib/mailbox/delivery.ts': ['exports'],
Expand All @@ -80,9 +80,9 @@ const config: KnipConfig = {
'packages/daemon/src/lib/mailbox/spawn.ts': ['exports'],
'packages/daemon/src/lib/messaging/space-adapter.ts': ['exports'],
'packages/daemon/src/lib/space/runtime/gate-evaluator.ts': ['exports'],
'packages/daemon/src/lib/space/runtime/post-approval-router.ts': ['exports'],
'packages/daemon/src/lib/space/runtime/retry-utils.ts': ['exports'],
'packages/daemon/src/lib/space/workflows/template-hash.ts': ['exports'],
'packages/daemon/src/lib/workflows/post-approval-route-selection.ts': ['exports'],
'packages/daemon/src/lib/utils/retry-utils.ts': ['exports'],
'packages/daemon/src/lib/workflows/template-hash.ts': ['exports'],
'packages/daemon/src/storage/repositories/goal-repository.ts': ['exports'],
},

Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import { createReactiveDatabase } from './storage/reactive-database.ts';
import { LiveQueryEngine } from './storage/live-query.ts';
import { installProcessFatalLogging } from './lib/process-fatal-logger.ts';
import { startEventLoopWatchdog, type EventLoopWatchdogHandle } from './lib/event-loop-watchdog.ts';
import { WorkflowHookRuntimeService } from './lib/space/workflow-hook-runtime-service.ts';
import { WorkflowHookRuntimeService } from './lib/workflows/hook-runtime-service.ts';
import { WorkflowHookStateRepository } from './storage/repositories/workflow-hook-state-repository.ts';
import { SpaceLongHorizonAgentRepository } from './storage/repositories/space-long-horizon-agent-repository.ts';
import { SpaceAgentReminderRepository } from './storage/repositories/space-agent-reminder-repository.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/lib/evolution/episode-service-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {
WorkflowRunArtifactRepository,
} from '../../storage/repositories/workflow-run-artifact-repository.ts';
import type { SpaceGoalService } from '../goals/service.ts';
import type { WorkflowArtifactProfile } from '../space/runtime/artifact-profile.ts';
import type { WorkflowArtifactProfile } from '../workflows/artifact-profile.ts';

export interface CreateEpisodeFromEvidenceParams {
scopeId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WorkflowHookResult } from '@hyperneo/shared';
import type { HookExecutorContext } from '../../space/runtime/hook-executor.ts';
import type { HookExecutorContext } from '../../workflows/hook-executor.ts';
import { getConnector } from './connector.ts';
import type { Predicate } from './predicate.ts';
import { evaluatePredicate } from './predicate.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/lib/github/connectors/presets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WorkflowHookResult } from '@hyperneo/shared';
import type { HookExecutorContext } from '../../space/runtime/hook-executor.ts';
import type { HookExecutorContext } from '../../workflows/hook-executor.ts';
import { spawnProcess, type SpawnFn } from '../../runtime-spawn/index.ts';
import { getConnector, registerConnector } from './connector.ts';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/lib/messaging/channel-matching.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SpaceWorkflow, WorkflowChannel, WorkflowNode } from '@hyperneo/shared';
import { isChannelCyclic, resolveNodeAgents } from '@hyperneo/shared';
import { POST_APPROVAL_TASK_AGENT_TARGET } from '../space/workflows/post-approval-validator.ts';
import { POST_APPROVAL_TASK_AGENT_TARGET } from '../workflows/post-approval-validator.ts';

export function findNodeByAgentName(
workflow: SpaceWorkflow,
Expand Down
8 changes: 4 additions & 4 deletions packages/daemon/src/lib/messaging/channel-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import type { NodeExecution } from '@hyperneo/shared';
import {
runTemplateResolves,
runTemplateSnapshotRecord,
} from '../space/workflows/run-template-snapshot.ts';
} from '../workflows/run-template-snapshot.ts';
import type { SpaceTaskRepository } from '../../storage/repositories/space-task-repository.ts';
import type { SpaceWorkflowRunRepository } from '../../storage/repositories/space-workflow-run-repository.ts';
import type { ChannelCycleRepository } from '../../storage/repositories/channel-cycle-repository.ts';
import type { NodeExecutionRepository } from '../../storage/repositories/node-execution-repository.ts';
import {
isReservedWorkflowAgentName,
type SpaceWorkflowManager,
} from '../space/managers/space-workflow-manager.ts';
import { TERMINAL_NODE_EXECUTION_STATUSES } from '../space/managers/node-execution-manager.ts';
} from '../workflows/workflow-manager.ts';
import { TERMINAL_NODE_EXECUTION_STATUSES } from '../workflows/node-execution-manager.ts';
import type { InternalEventBus, DaemonInternalEventMap } from '../internal-event-bus.ts';
import { Logger } from '../logger.ts';
import {
Expand All @@ -23,7 +23,7 @@ import {
formatMissingAgentReference,
formatMissingTemplateReference,
validateExecutionAgainstWorkflow,
} from '../space/runtime/workflow-node-execution-validation.ts';
} from '../workflows/node-execution-validation.ts';
import { reopenRun } from './activation-reopen.ts';
import { deadLoopReason, isDeadLoopReached, notifyDeadLoop } from './channel-cycle-bookkeeping.ts';
import {
Expand Down
13 changes: 5 additions & 8 deletions packages/daemon/src/lib/rpc-handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { recoverTaskExecution } from '../tasks/recover-task-execution.ts';
import { McpAuditLogRepository } from '../../storage/repositories/mcp-audit-log-repository.ts';
import { createSpaceOperationRegistryProvider } from '../tasks/operations.ts';
import { createCompletionGateBindings } from '../tasks/complete-task-gates.ts';
import { isCoderOwnedMergeWorkflow } from '../space/runtime/post-approval-router.ts';
import { isCoderOwnedMergeWorkflow } from '../workflows/post-approval-router.ts';
import { createGithubConnector } from '../github/connectors/github-connector.ts';
import { setupOperationHandlers } from './operation-handlers.ts';
import { createSpaceCallerScopeResolver } from '../space/runtime/space-caller-scope.ts';
Expand Down Expand Up @@ -50,19 +50,16 @@ import { NodeExecutionRepository } from '../../storage/repositories/node-executi
import { TaskAgentManager } from '../space/runtime/task-agent-manager.ts';
import { ReplyRoutingRegistry } from '../messaging/reply-routing-registry.ts';
import { SpaceWorktreeManager } from '../workspaces/worktree-manager.ts';
import { CodingArtifactProfile } from '../space/workflows/coding-artifact-profile.ts';
import { CodingArtifactProfile } from '../workflows/coding-artifact-profile.ts';
import {
setupSpaceWorkflowHandlers,
checkBuiltInWorkflowDriftOnStartup,
restampBuiltInWorkflowsOnStartup,
} from './space-workflow-handlers.ts';
import type { SpaceManager } from '../space/managers/space-manager.ts';
import { SpaceTaskManager } from '../tasks/task-manager.ts';
import {
SpaceWorkflowManager,
createSpaceAgentLookup,
} from '../space/managers/space-workflow-manager.ts';
import type { SpaceAgentLookup } from '../space/managers/space-workflow-manager.ts';
import { SpaceWorkflowManager, createSpaceAgentLookup } from '../workflows/workflow-manager.ts';
import type { SpaceAgentLookup } from '../workflows/workflow-manager.ts';
import { SpaceTaskRepository } from '../../storage/repositories/space-task-repository.ts';
import { SpaceWorkflowRunRepository } from '../../storage/repositories/space-workflow-run-repository.ts';
import { WorkflowRunArtifactRepository } from '../../storage/repositories/workflow-run-artifact-repository.ts';
Expand Down Expand Up @@ -101,7 +98,7 @@ import { SpaceAgentRepository } from '../../storage/repositories/space-agent-rep
import { SpaceAgentReminderRepository } from '../../storage/repositories/space-agent-reminder-repository.ts';
import { SpaceAgentSubscriptionRepository } from '../../storage/repositories/space-agent-subscription-repository.ts';
import { SpaceAgentTemplateManager } from '../agents/template-manager.ts';
import { createAgentTemplateResolverFactory } from '../space/workflows/run-template-snapshot.ts';
import { createAgentTemplateResolverFactory } from '../workflows/run-template-snapshot.ts';
import {
deliverSpaceAgentMessage,
type SessionInjectionOutcome,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import { isRunnableUnifiedAgent } from '../agents/worker-long-horizon-mapper.ts';
import { exportBundle, normalizeOverride, validateExportBundle } from '../space/export-format.ts';
import type { SpaceManager } from '../space/managers/space-manager.ts';
import type { SpaceWorkflowManager } from '../space/managers/space-workflow-manager.ts';
import type { SpaceWorkflowManager } from '../workflows/workflow-manager.ts';
import { RESERVED_SPACE_AGENT_HANDLES, slugifyWithinLimit } from '../space/slug.ts';

const log = new Logger('space-export-import-handlers');
Expand Down
4 changes: 2 additions & 2 deletions packages/daemon/src/lib/rpc-handlers/space-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {
} from '@hyperneo/shared';
import type { DaemonInternalEventMap, InternalEventBus } from '../internal-event-bus.ts';
import type { SpaceManager } from '../space/managers/space-manager.ts';
import type { SpaceWorkflowManager } from '../space/managers/space-workflow-manager.ts';
import type { SpaceWorkflowManager } from '../workflows/workflow-manager.ts';
import type { SpaceTaskRepository } from '../../storage/repositories/space-task-repository.ts';
import type { SpaceWorkflowRunRepository } from '../../storage/repositories/space-workflow-run-repository.ts';
import type { SessionManager } from '../session-manager.ts';
Expand All @@ -27,7 +27,7 @@ import {
type DeleteSpaceResult,
} from '../space/managers/delete-space-pipeline.ts';
import { createSpace, type CreateSpaceDeps } from '../space/create-space-pipeline.ts';
import { seedBuiltInWorkflows } from '../space/workflows/built-in-workflows.ts';
import { seedBuiltInWorkflows } from '../workflows/seed-built-in-workflows.ts';
import { Logger } from '../logger.ts';

const log = new Logger('space-handlers');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import type {
} from '@hyperneo/shared';
import type { DaemonInternalEventMap, InternalEventBus } from '../internal-event-bus.ts';
import type { SpaceManager } from '../space/managers/space-manager.ts';
import type { SpaceWorkflowManager } from '../space/managers/space-workflow-manager.ts';
import type { SpaceWorkflowManager } from '../workflows/workflow-manager.ts';
import {
getBuiltInWorkflows,
resolveBuiltInWorkflowTemplate,
seedBuiltInWorkflows,
} from '../space/workflows/built-in-workflows.ts';
import { computeWorkflowHash } from '../space/workflows/template-hash.ts';
} from '../workflows/built-in-workflows.ts';
import { seedBuiltInWorkflows } from '../workflows/seed-built-in-workflows.ts';
import { computeWorkflowHash } from '../workflows/template-hash.ts';
import type { SpaceWorkflowRunRepository } from '../../storage/repositories/space-workflow-run-repository.ts';
import { Logger } from '../logger.ts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isAbsolute } from 'node:path';
import type { MessageHub, SpaceTask } from '@hyperneo/shared';
import type { DaemonInternalEventMap, InternalEventBus } from '../internal-event-bus.ts';
import type { SpaceManager } from '../space/managers/space-manager.ts';
import type { SpaceWorkflowManager } from '../space/managers/space-workflow-manager.ts';
import type { SpaceWorkflowManager } from '../workflows/workflow-manager.ts';
import type { SpaceWorkflowRunRepository } from '../../storage/repositories/space-workflow-run-repository.ts';
import type { WorkflowRunArtifactRepository } from '../../storage/repositories/workflow-run-artifact-repository.ts';
import type { WorkflowRunArtifactCacheRepository } from '../../storage/repositories/workflow-run-artifact-cache-repository.ts';
Expand All @@ -17,7 +17,7 @@ import type { WorkflowRunStatus } from '@hyperneo/shared';
import {
QUEUED_RETRYABLE_ACTION_STATE_KEY,
triggerRetryableHookAction,
} from '../space/runtime/workflow-hook-engine.ts';
} from '../workflows/hook-engine.ts';
import {
execGit,
isGitRepo,
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/lib/session/model-pool-scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
AgentModelPoolEntry,
WorkflowNodeAgent,
} from '@hyperneo/shared';
import { TransientSpawnError } from '../space/runtime/workflow-node-execution-validation.ts';
import { TransientSpawnError } from '../workflows/node-execution-validation.ts';

const SPAWN_GRACE_MS = 15_000;

Expand Down
6 changes: 3 additions & 3 deletions packages/daemon/src/lib/space/actions/node-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import { Logger } from '../../logger.ts';
import type { SpaceGoalService } from '../../goals/service.ts';
import { translateLegacyNodeTargets } from '../../messaging/space-adapter.ts';
import type { AgentMessageRouter } from '../../messaging/agent-message-router.ts';
import type { WorkflowArtifactProfile } from '../runtime/artifact-profile.ts';
import type { WorkflowArtifactProfile } from '../../workflows/artifact-profile.ts';
import type { ChannelResolver } from '../../messaging/channel-resolver.ts';
import { buildPrEventTopicPattern, parsePrUrl } from '../../github/parse-pr-url.ts';
import type { WorkflowHookEngine } from '../runtime/workflow-hook-engine.ts';
import { wrapHandlerWithHooks } from '../runtime/workflow-hook-engine.ts';
import type { WorkflowHookEngine } from '../../workflows/hook-engine.ts';
import { wrapHandlerWithHooks } from '../../workflows/hook-engine.ts';
import type {
ArchiveTaskInput,
CreateStandaloneTaskInput,
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/lib/space/actions/registry-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
resolveOperationRegistry,
} from '../../operations/registry.ts';
import type { SpaceMcpSessionRole } from '../runtime/space-mcp-session-policy.ts';
import { wrapHandlerWithHooks } from '../runtime/workflow-hook-engine.ts';
import { wrapHandlerWithHooks } from '../../workflows/hook-engine.ts';
import type { ToolResult } from '../tools/tool-result.ts';
import { runMarkCompleteOperation } from './mark-complete-operation.ts';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/lib/space/actions/registry-space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import type { z } from 'zod';
import type { OperationRegistrySource } from '../../operations/registry.ts';
import { hasSpaceAuthority } from '../runtime/space-mcp-session-policy.ts';
import { canTransition as canTransitionRunStatus } from '../runtime/workflow-run-status-machine.ts';
import { canTransition as canTransitionRunStatus } from '../../workflows/run-status-machine.ts';
import { normalizeReplyTargetHandle } from '../../messaging/agent-handle.ts';
import {
HUMAN_ONLY_AUTONOMY_LEVEL,
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/lib/space/actions/space-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ import {
} from '../../agents/template-manager.ts';
import type { SpaceManager } from '../managers/space-manager.ts';
import { assertValidSpaceTaskTransition, type SpaceTaskManager } from '../../tasks/task-manager.ts';
import type { SpaceWorkflowManager } from '../managers/space-workflow-manager.ts';
import type { SpaceWorkflowManager } from '../../workflows/workflow-manager.ts';
import { SpaceDeliveryFacade, translateTaskMessageTarget } from '../../messaging/space-adapter.ts';
import {
createBoundSpaceTaskMetadataEditor,
Expand Down
20 changes: 10 additions & 10 deletions packages/daemon/src/lib/space/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export {
SpaceTaskManager,
VALID_SPACE_TASK_TRANSITIONS,
} from '../tasks/task-manager.ts';
export type { SpaceAgentLookup } from './managers/space-workflow-manager.ts';
export type { SpaceAgentLookup } from '../workflows/workflow-manager.ts';
export {
SpaceWorkflowManager,
WorkflowDeletionBlockedError,
WorkflowValidationError,
} from './managers/space-workflow-manager.ts';
} from '../workflows/workflow-manager.ts';
export {
SpaceWorkspaceManager,
WorkspaceRegistrationError,
Expand All @@ -65,16 +65,16 @@ export type {
CommandRunner,
ConditionContext,
ConditionResult,
} from './runtime/workflow-executor.ts';
export { WorkflowExecutor } from './runtime/workflow-executor.ts';
export type { WorkflowSelectionContext } from './runtime/workflow-selector.ts';
export { selectWorkflow } from './runtime/workflow-selector.ts';
export { WorkflowHookRuntimeService } from './workflow-hook-runtime-service.ts';
export { validateWorkflowHooks } from './workflow-hook-validation.ts';
} from '../workflows/workflow-executor.ts';
export { WorkflowExecutor } from '../workflows/workflow-executor.ts';
export type { WorkflowSelectionContext } from '../workflows/workflow-selector.ts';
export { selectWorkflow } from '../workflows/workflow-selector.ts';
export { WorkflowHookRuntimeService } from '../workflows/hook-runtime-service.ts';
export { validateWorkflowHooks } from '../workflows/hook-validation.ts';
export {
CODING_WORKFLOW,
getBuiltInWorkflows,
RESEARCH_WORKFLOW,
REVIEW_ONLY_WORKFLOW,
seedBuiltInWorkflows,
} from './workflows/built-in-workflows.ts';
} from '../workflows/built-in-workflows.ts';
export { seedBuiltInWorkflows } from '../workflows/seed-built-in-workflows.ts';
Loading
Loading