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
2 changes: 1 addition & 1 deletion docs/GLM_NATIVE_PROMPT.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tool-loop expectations.

## Prompt Shape

The shared prompt builder in `src/prompt.js` creates:
The shared prompt builder in `src/prompt.ts` creates:

1. `GLM-NATIVE OPERATING CONTRACT`
2. Existing one-shot working rules or REPL persona
Expand Down
28 changes: 14 additions & 14 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ LazyGLM itself, not smoke tests around another agent.

### Compaction handoff digest

`src/agent/context.js` compacts by pinning the original user task and replacing
`src/agent/context.ts` compacts by pinning the original user task and replacing
the dropped transcript middle with a deterministic digest. The digest is plain
text and currently emits sections in this order when data exists:

Expand Down Expand Up @@ -129,23 +129,23 @@ handoff; correctness still comes from repo inspection, tests, and verification.

```text
bin/lazyglm.js CLI entrypoint
src/cli.js command dispatcher (run | chat/REPL | install | uninstall | doctor | models | skills | skill | hook)
src/config.js global user config (~/.lazyglm/config.json, chmod 600; key never in process.env)
src/onboard.js first-run onboarding (provider + key)
src/repl.js interactive REPL (streaming + tools + hooks + sessions)
src/sessions.js session persistence (JSONL under ~/.lazyglm/sessions/)
src/cli.ts command dispatcher (run | chat/REPL | install | uninstall | doctor | models | skills | skill | hook)
src/config.ts global user config (~/.lazyglm/config.json, chmod 600; key never in process.env)
src/onboard.ts first-run onboarding (provider + key)
src/repl.ts interactive REPL (streaming + tools + hooks + sessions)
src/sessions.ts session persistence (JSONL under ~/.lazyglm/sessions/)
src/agent/
provider.js OpenAI-compatible GLM provider (z.ai / Nous / Ollama / custom)
router.js role -> model routing + provider-aware model IDs
tools.js read_file, write_file, patch_file, list_dir, grep, run_shell, finish
runtime.js one-shot tool-use loop: model -> tools -> hooks -> repeat until finish()
context.js message bookkeeping + task-preserving compaction
provider.ts OpenAI-compatible GLM provider (z.ai / Nous / Ollama / custom)
router.ts role -> model routing + provider-aware model IDs
tools.ts read_file, write_file, patch_file, list_dir, grep, run_shell, finish
runtime.ts one-shot tool-use loop: model -> tools -> hooks -> repeat until finish()
context.ts message bookkeeping + task-preserving compaction
src/hooks/ hook engine + protocol schema
src/plugins/ discipline plugins
src/skills/ skill loader for `$command` invocations
src/installer.js `lazyglm install`
src/doctor.js provider/model/routing/plugin/skill health report
src/ulw.js Ultrawork verified-completion loop
src/installer.ts `lazyglm install`
src/doctor.ts provider/model/routing/plugin/skill health report
src/ulw.ts Ultrawork verified-completion loop
config/model-catalog.json GLM models, providers, roles, context windows, reasoning effort
```

Expand Down
16 changes: 13 additions & 3 deletions docs/typescript-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,17 @@ The second migration phase converts the contract-heavy agent boundary modules to
- `src/agent/tool-errors.ts`
- `src/agent/adaptive-router.ts`

These modules now consume shared contracts from `src/types/index.ts` directly. Provider wire JSON remains module-private typed data, and out-of-scope support modules (`context.js`, `deadline.js`, `thinking.js`) remain JavaScript compiled by the Phase 1 `allowJs` pipeline.
These modules now consume shared contracts from `src/types/index.ts` directly. Provider wire JSON remains module-private typed data, while support modules are converted in the final CLI/REPL phase below.

### Phase 5 — CLI, REPL, sessions, and runtime support modules

The final runtime migration phase converts the remaining source JavaScript modules to TypeScript while preserving NodeNext `.js` import specifiers in source:

- CLI, REPL, session, doctor, installer, update, onboarding, banner, status, and output helpers
- `src/agent/context.ts`, `src/agent/deadline.ts`, and `src/agent/thinking.ts`
- `src/prompt.ts` and `src/scaffold/handoff.ts`

After this phase, no runtime `.js` source files remain under `src/`. The executable shim stays JavaScript at `bin/lazyglm.js` and continues to import compiled output from `dist/`.

Tests that exercise converted boundaries import from `dist/` after `npm run build`, matching the package runtime boundary used by `bin/lazyglm.js`.

Expand All @@ -55,8 +65,8 @@ Tests that exercise converted boundaries import from `dist/` after `npm run buil
These remain outside the Phase 1/2 work:

- enabling `checkJs` globally;
- converting agent support, hooks, config, MCP, plugin, installer, CLI, REPL, or test files to `.ts`;
- typechecking additional JavaScript boundaries beyond the current converted agent boundary surface;
- converting test files to `.ts`;
- enabling typechecking for non-runtime JavaScript outside `src/`;
- source maps for compiled stack traces;
- changing `package.json` `engines` or version;
- changing runtime behavior, model routing, hook semantics, tool calls, REPL UX, sessions, or publishing flow.
Expand Down
Loading
Loading