Archon/packages/cli/tsconfig.json
Rasmus Widing 5443e0beab
refactor: extract @archon/workflows package from @archon/core (#507)
* refactor: extract @archon/workflows package from @archon/core

Move the workflow engine (~14K lines) from @archon/core into a standalone
@archon/workflows package. The engine (loader, router, executor, DAG executor,
event emitter, JSONL logger, bundled defaults, variable substitution) now lives
in packages/workflows/ with dependencies only on @archon/git and @archon/paths.

Database operations, AI client creation, and config loading are injected via a
WorkflowDeps object and IWorkflowStore trait interface — mirroring the
IIsolationStore pattern from the @archon/isolation extraction.

Key changes:
- CREATE packages/workflows/ with all workflow engine source files
- CREATE IWorkflowStore trait + WorkflowDeps dependency injection
- CREATE store-adapter.ts in core to bridge DB modules to IWorkflowStore
- UPDATE executeWorkflow signature to accept WorkflowDeps as first param
- UPDATE all consumers (orchestrator, CLI) to construct and pass WorkflowDeps
- UPDATE discoverWorkflows to use options object instead of positional args
- DELETE original workflow files from core (~14,800 lines removed)
- UPDATE all imports across packages to use @archon/workflows
- ADD text-imports.d.ts references to downstream tsconfigs

Zero behavior changes. All existing tests pass. @archon/core re-exports all
workflow symbols for backward compatibility.

* docs: update CLAUDE.md for @archon/workflows package extraction

Add the new @archon/workflows package to the directory structure,
architecture layers, and import patterns sections. Update @archon/core
description to reflect it now re-exports from @archon/workflows rather
than housing the workflow engine directly.

* fix: address PR review - restore tests, remove compat shims, tighten types

- Move 8 test files (373 tests) to @archon/workflows with WorkflowDeps
  mock injection replacing direct DB/client module mocks
- Remove backward compat re-exports from @archon/core — all consumers
  now import workflow symbols directly from @archon/workflows
- Fix loadDefaultWorkflows config: callers now load config and pass
  loadDefaults option to discoverWorkflows (was silently ignored)
- Add .catch() with logging to all 18 fire-and-forget createWorkflowEvent
  calls in executor.ts, matching dag-executor.ts pattern
- Narrow AssistantClientFactory provider param: string → 'claude' | 'codex'
- Type createWorkflowEvent event_type with WorkflowEventType union
- Remove optional marker from WorkflowConfig.assistants.claude
- Strengthen IWorkflowStore.createWorkflowEvent JSDoc contract
- Fix log level inconsistencies (resolveProjectPaths, loadCommandPrompt)
- Update CLAUDE.md to reflect no-shim architecture

* fix: address review - extract helper, add tests, tighten types and docs

- Extract discoverWorkflowsWithConfig() helper in @archon/workflows to
  eliminate 8 duplicate loadConfig+discoverWorkflows try/catch blocks
  across command-handler, orchestrator-agent, cli/workflow, and api.ts.
  Config load failures now logged at warn level in one place.

- Add createWorkflowDeps() factory in store-adapter.ts to consolidate 4
  inline WorkflowDeps construction sites into a single point.

- Add compile-time assertion that MergedConfig satisfies WorkflowConfig
  to catch structural drift between the two interfaces.

- Wrap createWorkflowEvent in store adapter with try/catch to enforce
  the non-throwing contract at the boundary.

- Add store-adapter.test.ts (7 tests) covering method wiring, the
  status cast, and the non-throwing wrapper.

- Add globalSearchPath integration tests (3) and
  discoverWorkflowsWithConfig tests (3) to loader.test.ts.

- Fix 4 failing orchestrator.test.ts assertions for new signature.

- Fix stale module docstring in @archon/core index.ts.

- Fix inaccurate createWorkflowEvent JSDoc in store.ts.

- Improve comments in deps.ts (circular dep rationale, IWorkflowPlatform
  exclusions, WorkflowConfig scope) and store-adapter.ts (SQL column).

- Fix emitValidationResults to log non-ENOENT access errors instead of
  silently swallowing them.

* chore: Auto-commit workflow artifacts (archon-test-loop)
2026-02-26 12:51:29 +02:00

16 lines
549 B
JSON

{
"extends": "../../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"paths": {
"@archon/core": ["../core/src"],
"@archon/core/*": ["../core/src/*"],
"@archon/workflows": ["../workflows/src"],
"@archon/workflows/*": ["../workflows/src/*"],
"@archon/paths": ["../paths/src"],
"@archon/git": ["../git/src"]
}
},
"include": ["src/**/*", "../core/src/**/*.ts", "../workflows/src/defaults/text-imports.d.ts"],
"exclude": ["node_modules", "dist", "**/*.test.ts", "../core/src/**/*.test.ts"]
}