index.ts: LoopState is part of the PromptGenerator extension contract but is not re-exported from the package root
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- api
Direzione di ricerca
Inizia da src/index.ts e confronta le sue esportazioni pubbliche di tipi con la definizione di LoopState in src/util/loop-state.ts. Controlla l’utilizzo esistente in src/test/loop.test.ts, quindi esegui i test TypeScript pertinenti o la build. Il lavoro è completato quando un consumer può importare LoopState dalla root del package senza usare il sottopercorso non documentato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Observed behavior
src/index.ts re-exports the types needed to implement the documented extension points (Agent, PromptGenerator, Reporter) but it does not re-export LoopState. LoopState appears in the public PromptGenerator contract:
// src/prompt-generators.ts
export interface PromptGenerator {
generate(loopState: LoopState): AsyncIterable<Prompt>;
}
A consumer who follows the README's "Custom Prompt Generator" pattern and depends only on the package root cannot type the loopState parameter:
import type { Prompt, PromptGenerator } from 'loop-the-loop';
import type { LoopState } from 'loop-the-loop';
// error TS2305: Module '"loop-the-loop"' has no exported member 'LoopState'.
The class still has to declare a parameter, so today the only working option is to reach into an undocumented subpath:
import type { LoopState } from 'loop-the-loop/util/loop-state';
The in-tree integration test already does exactly this (src/__test__/loop.test.ts line 18), which suggests it was not a deliberate omission so much as a missing re-export.
Expected behavior
LoopState should be re-exported from src/index.ts so that a downstream PromptGenerator implementation can be written using only import ... from 'loop-the-loop'. The README in fact already advertises this contract:
All extension-relevant types are exported from the package root (
src/index.ts)
LoopState is currently the only extension-relevant type that violates that claim.
Minimal reproduction
// repro.ts
import type { Prompt, PromptGenerator } from 'loop-the-loop';
import type { LoopState } from 'loop-the-loop';
class MyGen implements PromptGenerator {
async *generate(_state: LoopState): AsyncIterable<Prompt> {
yield { id: '1', prompt: 'hi' };
}
}
$ tsc --noEmit repro.ts
repro.ts(2,15): error TS2305: Module '"loop-the-loop"' has no exported member 'LoopState'.
Suggested fix
Add a type-only re-export to src/index.ts:
export type { LoopState } from './util/loop-state.js';
LoopState exposes mutating methods (begin, end, save), so a type-only export feels right for the extension surface; consumers of PromptGenerator only need isOutstanding(id) to author a generator.
Severity
S3. The library is still usable: the deep import path works thanks to the "./*" wildcard in package.json#exports. The bug is that the documented extension contract is incomplete, so writing a custom PromptGenerator from the package root currently requires an undocumented internal path.
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di joewalker/loop-the-loop
-
bug S4
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal informationApertabug S3
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
joewalker/loop-the-loop#83 ·
-
bug S3
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
joewalker/loop-the-loop#82 ·
-
bug S4
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
joewalker/loop-the-loop#79 ·
Tutte le issue di joewalker/loop-the-loop
Issue simili
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
docs(api): openapi.yaml still documents gif-tools optimize colors as 2-256 instead of 2, 4, 16, 256Apertaarea: backend documentation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
snapotter-hq/SnapOtter#2919 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
obsidianmd/pele#39 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
biomejs/biome#12475 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno