Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9d40d4e
refactor(cli-forge): replace scattered any casts with AnyCLI/AnyInter…
AgentEnder Apr 11, 2026
fb9f22c
fix(cli-forge): use any in AnyCLI/AnyInternalCLI for assignability
AgentEnder Apr 11, 2026
f620a2f
refactor(cli-forge): add TProviders generic parameter to CLI interface
AgentEnder Apr 11, 2026
ac6b414
chore(cli-forge): add AsyncLocalStorage infrastructure with browser f…
AgentEnder Apr 11, 2026
222e199
feat(cli-forge): add .provide() method for registering DI providers
AgentEnder Apr 11, 2026
01898ec
fix(cli-forge): add missing TProviders to middleware return type and …
AgentEnder Apr 11, 2026
36aa68d
feat(cli-forge): add getCommandContext and CommandContext for DI access
AgentEnder Apr 11, 2026
de985f6
feat(cli-forge): add getCommandContext and CommandContext for DI access
AgentEnder Apr 11, 2026
0098575
feat(cli-forge): wire AsyncLocalStorage into forge() and sdk() execution
AgentEnder Apr 11, 2026
795b3e4
feat(cli-forge): add TestHarness.mockContext for testing DI providers
AgentEnder Apr 11, 2026
c65850d
fix(cli-forge): fix mockContext type constraint and test type errors
AgentEnder Apr 11, 2026
b921416
chore(cli-forge): add type tests for provider injection and context i…
AgentEnder Apr 11, 2026
9a36910
fix(cli-forge): use sentinel in inject() to distinguish missing vs un…
AgentEnder Apr 11, 2026
596817c
docs(cli-forge): add providers example demonstrating DI pattern
AgentEnder Apr 11, 2026
f92286d
fix(cli-forge): use {} for builder TProviders so .provide() works in …
AgentEnder Apr 11, 2026
7738a87
docs(cli-forge): add dependency injection design spec and implementat…
AgentEnder Apr 11, 2026
25feeae
fix(cli-forge): fixup any cli typing
AgentEnder Apr 11, 2026
6c1eeac
docs(cli-forge): add DI logger example that obeys log level from args
claude Apr 12, 2026
e9e9204
fix(cli-forge): runtime safety fixes for DI context
claude Apr 12, 2026
03d74ff
feat(cli-forge): factory-aware TestHarness mockContext + runWithMocke…
claude Apr 12, 2026
3c7b78d
docs(cli-forge): dependency injection guide and subcommand comment up…
claude Apr 12, 2026
6d0cbcf
docs(cli-forge): recommend passing subcommand CLI directly when provi…
claude Apr 12, 2026
b51e6ad
fix(cli-forge): address DI review comments
claude Apr 12, 2026
34e7fb1
feat(cli-forge): add cli.getContext() instance method
claude Apr 12, 2026
79922a2
test(cli-forge): type-check cli.getContext() return type
claude Apr 12, 2026
503708f
refactor(cli-forge): take TProviders/TParent directly in getContext()…
claude Apr 12, 2026
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
1,411 changes: 1,411 additions & 0 deletions .ai/plans/dependency-injection/implementation-plan.md

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions .ai/plans/dependency-injection/issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Plan Review — Resolved Issues

All issues from the initial review have been addressed in the updated plan.

## Resolved

| # | Severity | Issue | Resolution |
|---|----------|-------|------------|
| 1 | High | Module-level `Map` breaks under async/concurrent SDK execution | AsyncLocalStorage with browser fallback stub. ALS scopes context per async execution chain. |
| 2 | High | `global` factories taking `factory(args)` are unsound | Global factories use `() => T` (no args). Args-dependent providers must use `executionScope`. |
| 3 | High | Lazy factory resolution during discovery sees partial args | Provider execution deferred to handler phase. `inject()` throws during middleware/init. |
| 4 | Medium | Type merge `&` produces intersection, not override semantics | Same-level duplicates forbidden (type error). Child-shadows-parent uses `Omit` for override semantics. |
| 5 | Medium | SDK clones don't match identity-based lookup | ALS handles execution scoping. CLI parameter is a type-level witness only. |
| 6 | Medium | Testing section inconsistent with current test harness API | Fixed to `new TestHarness(cli)`. Setup/teardown pattern hides ALS as implementation detail. |
| 7 | Medium | Change surface underestimated for 5th generic | AnyCLI pass as prerequisite. Full file list updated including `composable-builder.ts`. |

## Plan Inconsistencies (also fixed)

| Issue | Fix |
|-------|-----|
| `export const app = ... .forge()` invalid — `forge()` returns `Promise<TArgs>` | Example now shows `await app.forge()` as a standalone call |
| Test example missing child context for `target` | Mock now includes `target` in args and `commandChain: ['deploy']` |
| `updateConfig` provenance note | Removed — routes to existing parser config behavior, no new mechanism needed |
Loading
Loading