{"_id":"@adaptive-ds/codeline","name":"@adaptive-ds/codeline","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@adaptive-ds/codeline","version":"0.1.0","description":"An AI coding workspace built for the fastest possible UI/UX with Zero's immediate, incrementally updated queries.","private":false,"license":"MIT","type":"module","homepage":"http://codeline.work/","bugs":{"url":"https://github.com/david1gp/codeline/issues"},"repository":{"type":"git","url":"git+https://github.com/david1gp/codeline.git"},"keywords":["ai","ai-native","coding-assistant","coding-workspace","developer-tools","realtime","tanstack-ai","solidjs","hono","zero","postgresql","typescript","bun","adaptive-ds"],"scripts":{"dev":"bun run --parallel dev:api dev:ui","dev:api":"bun run --watch src/index.ts","dev:ui":"vite","test":"bun test","typecheck":"bun tsc -p tsconfig.json --noEmit","build":"rm -rf ./dist && bun tsc -p ./tsconfig.json && env -u VITE_USER_NODE_ENV -u VITE_ZERO_CACHE_URL -u VITE_ZERO_QUERY_URL -u VITE_ZERO_MUTATE_URL NODE_ENV=production vite build --mode production && bun build ./src/ui/pwa/serviceWorkerMain.ts --outfile ./dist/ui/service-worker.js --target browser --format iife --minify && bun build ./src/index.ts --outdir ./dist/server --target bun --sourcemap=external --external valibot","release":"bash ./ops/release.sh","release:inputs:verify":"bun scripts/releaseInputsVerify.ts","git-store:link":"bash ./ops/dev/git-store-link.sh setup","git-store:verify":"bash ./ops/dev/git-store-link.sh verify","zero:link":"bash ./ops/dev/zero-link.sh setup","zero:verify":"bash ./ops/dev/zero-link.sh verify","db:generate":"drizzle-kit generate --config drizzle.config.ts","db:migrate":"drizzle-kit migrate --config drizzle.config.ts","db:seed":"drizzle-kit migrate --config drizzle.config.ts && bun scripts/dbSeed.ts","db:check":"drizzle-kit check --config drizzle.config.ts","format":"biome format --write src test scripts ui index.html vite.config.ts package.json release-inputs.json tsconfig.json tsconfig.build.json biome.json bunfig.toml drizzle.config.ts","format:check":"biome format src test scripts ui index.html vite.config.ts package.json release-inputs.json tsconfig.json tsconfig.build.json biome.json bunfig.toml drizzle.config.ts","ui":"rsync -avh --delete ../solid-ui/ui/ ./ui/","ui:push":"rsync -avh --delete ./ui/ ../solid-ui/ui/"},"imports":{"#ui/*":"./ui/*","#utils/*":"@adaptive-ds/utils/*"},"dependencies":{"@adaptive-ds/git-store":"link:@adaptive-ds/git-store","@adaptive-ds/result":"^0.6.0","@adaptive-ds/solid-ui":"^0.18.0","@corvu/popover":"^0.2.0","@mdi/js":"^7.4.47","@rocicorp/zero":"link:@rocicorp/zero","@solidjs/router":"^1.0.0","@tanstack/ai":"^0.44.0","@tanstack/ai-client":"^0.23.2","@tanstack/ai-openai":"0.19.0","@tanstack/ai-solid":"^0.16.2","@tanstack/ai-solid-ui":"^0.7.15","clsx":"^2.1.1","drizzle-orm":"0.45.2","hono":"^4.12.8","micromark":"^4.0.2","oauth4webapi":"^3.8.7","postgres":"3.4.9","solid-js":"^1.9.12","tailwind-merge":"^3.6.0","valibot":"^1.3.1","yaml":"^2.9.0","zod":"^4.0.0"},"devDependencies":{"@biomejs/biome":"^2.5.2","@tailwindcss/vite":"^4.3.3","@types/bun":"^1.3.14","drizzle-kit":"0.31.10","tailwindcss":"^4.3.3","typescript":"^6.0.3","vite":"^8.2.1","vite-plugin-solid":"^2.11.14"},"author":{"name":"David Siewert","url":"https://david-siewert.com/"},"funding":{"type":"individual","url":"https://github.com/sponsors/david1gp"},"engines":{"bun":">=1.3.0"},"gitHead":"f1e8d645afeca53863a49f51117e1fc6ddb1a059","_id":"@adaptive-ds/codeline@0.1.0","_nodeVersion":"26.7.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-gqnYgHlCcCMxVqQ/RyFxYQg+4a/A9CU1q3JTDNd5pFEKA99Q3j38upnHea99hc2nIkb5RVHSrbUfaYCWph+1FQ==","shasum":"c09cc0de398393486ab9c154d7cfaf7aea6f0794","tarball":"https://registry.npmjs.org/@adaptive-ds/codeline/-/codeline-0.1.0.tgz","fileCount":1055,"unpackedSize":2582910,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIF9ooP7p2yIWoxI9qOgiux8br78HTd5kF4rkwkmCLBFUAiAel6fROyRJYYY/LqnbnCkmTZUYT/DJ/DxLIm/rL3awgg=="}]},"_npmUser":{"name":"david1gp","email":"david1gruppenplan@gmail.com"},"directories":{},"maintainers":[{"name":"david1gp","email":"david1gruppenplan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/codeline_0.1.0_1786854308306_0.6629636448783134"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-16T04:25:08.143Z","0.1.0":"2026-08-16T04:25:08.524Z","modified":"2026-08-16T04:25:08.757Z"},"maintainers":[{"name":"david1gp","email":"david1gruppenplan@gmail.com"}],"description":"An AI coding workspace built for the fastest possible UI/UX with Zero's immediate, incrementally updated queries.","homepage":"http://codeline.work/","keywords":["ai","ai-native","coding-assistant","coding-workspace","developer-tools","realtime","tanstack-ai","solidjs","hono","zero","postgresql","typescript","bun","adaptive-ds"],"repository":{"type":"git","url":"git+https://github.com/david1gp/codeline.git"},"author":{"name":"David Siewert","url":"https://david-siewert.com/"},"bugs":{"url":"https://github.com/david1gp/codeline/issues"},"license":"MIT","readme":"# @adaptive-ds/codeline\n\nCodeline is an AI coding workspace built for the fastest possible UI/UX. Its foundation is [Rocicorp Zero](https://zero.rocicorp.dev/), which turns durable PostgreSQL state into reactive browser data so the interface can stay synchronized and feel immediate.\n\nThe goal is AI coding that does not suck: instant feedback, durable application state, and a focused workspace that stays out of the way.\n\n- **Immediate reads** — Zero answers queries from client-side data first, then follows with authoritative server results\n- **Incremental live queries** — synchronized changes update existing query results instead of requiring full refetches\n- **Fine-grained rendering** — SolidJS and `@adaptive-ds/solid-ui` update only the UI affected by those changes\n- **Durable server state** — PostgreSQL and Drizzle own application data while Zero makes it reactive in the browser\n- **Explicit boundaries** — Hono, Valibot, and TanStack AI provide typed APIs, validation, and streaming seams\n- **Simple toolchain** — Bun and TypeScript power development, testing, and production builds\n\nQuick Links\n\n- site - http://codeline.work/\n- code - https://github.com/david1gp/codeline\n- issues - https://github.com/david1gp/codeline/issues\n- solid-ui - https://github.com/david1gp/solid-ui\n- zero - https://zero.rocicorp.dev/\n- zero code - https://github.com/rocicorp/mono\n\n## Status\n\nCodeline is a runnable AI coding workspace. It provides synchronized session navigation, provider-backed chat execution, durable messages and execution events, stream replay, bounded retries and subagents, project/file browsing, Git branch controls, Markdown rendering, provider/model selection, simulation fixtures, and a responsive `/demo` showcase. It also includes provider-neutral OIDC/PKCE authentication, protected UI state, Zero cache isolation, and an installable PWA baseline.\n\nThe Hono API persists durable state in PostgreSQL through Drizzle. Zero synchronizes authorized reads into the browser; commands and chat execution continue to go through the application API. The chat runtime supports deterministic fixtures and the configured local CLIProxyAPI/Codex-LB provider targets.\n\nLocal development and verification currently use the pinned local Zero and git-store checkouts through Bun links. `bun run release` runs the local format, test, and build preflight; `bun run deploy` runs the local build preflight only. GitHub release artifacts, clean-clone/CI reproducibility, and deployment automation are deferred and are not current priorities.\n\nProvider OAuth, Pi ecosystem integrations, MCP, full-text web search, custom scrollbar behavior, trusted folders / project trust, editing or limiting AI capabilities, and AI permission management are out of scope.\n\n## Source Layout\n\nThe repository root contains checked-in provider model definitions and agent configurations alongside application source code:\n\n```txt\nproviders/\n├── cliproxyapi/{model}.yml\n└── codex-lb/{model}.yml\nagents/\n└── {name}.md\nsrc/\n├── identity/{api,db}\n├── servers/{api,actions,db,schema}\n├── agents/{actions,api,db,schema}\n├── session/{api,actions,db,schema}\n├── message/{api,actions,db,schema}\n├── stream/db\n├── database/\n├── api/\n├── app/\n├── configuration/\n├── providers/{api,catalog,runtime,schema,ui}\n├── server/\n└── ui/\n```\n\n- `providers/{provider}/{model}.yml` defines provider model metadata, connection parameters, capabilities, costs, and effort variants.\n- `agents/{name}.md` defines primary agents and subagents via YAML frontmatter and Markdown prompt bodies.\n- `schema/` holds Valibot request and query contracts for that context.\n- `api/` holds Hono route registration only.\n- `actions/` holds application operations such as `sessionCreate` and `serverList`.\n- `db/` holds Drizzle tables and repositories.\n- `database/` holds shared persistence infrastructure only: the client, transactions, migrations, `databaseSchema.ts`, and `zeroSchema.ts`.\n- `api/` at the top level holds platform HTTP only: health, readiness, errors, testing, and route composition.\n- `server/` is the HTTP process. The server domain context is `servers/`.\n\nHTTP paths can nest across contexts. Agent routes stay at `/servers/:serverId/agents` and message routes stay at `/sessions/:sessionId/messages`; the owning context still registers them.\n\n## Implemented Routes\n\nHealth and readiness:\n\n- `GET /health` and `GET /api/health` return the Codeline health response.\n- `GET /api/ready` reports process readiness.\n\nWorkspace and catalog data:\n\n- `GET /api/servers` and `GET /api/servers/:serverId/agents`\n- `GET /api/servers/:serverId/agents/:agentId`, `POST /api/servers/:serverId/agents`, `PATCH /api/servers/:serverId/agents/:agentId`\n- `POST /api/servers/:serverId/agents/models`, `POST /api/servers/:serverId/agents/connection-test`\n- `POST /api/servers/:serverId/agents/:agentId/models`, `POST /api/servers/:serverId/agents/:agentId/connection-test`\n- `GET /api/providers/catalog` (returns redacted catalog providers, models, and agents)\n- `POST /api/providers/models`, `POST /api/providers/connection-test`\n- `GET /api/sessions`, `POST /api/sessions`\n- `GET /api/sessions/:sessionId`, `PATCH /api/sessions/:sessionId`\n- `POST /api/sessions/:sessionId/archive`, `DELETE /api/sessions/:sessionId`\n- `GET /api/sessions/:sessionId/messages`, `POST /api/sessions/:sessionId/messages`\n\nTest seams:\n\n- `POST /api/testing/echo` accepts `{ \"message\": \"...\" }` and rejects an empty or invalid message with a structured `400`.\n- `GET /api/testing/errors/bad-request` and `GET /api/testing/errors/internal-server-error` return deterministic structured errors.\n- `GET /api/testing/stream` returns `text/event-stream` events with sequential IDs. `scenario` is `normal`, `error`, `unexpected-end`, or `idle-timeout`; optional `delayMs` and `idleTimeoutMs` values must be between 1 and 60000 milliseconds.\n\n## Provider and Agent Catalogs\n\nCodeline defines provider models and agent configurations through checked-in filesystem files in the repository root.\n\n### Provider Model Catalog (`providers/{provider}/{model}.yml`)\n\n- **ID and File Naming**:\n  - Provider ID derives from the parent directory name `providers/{provider}` (`cliproxy` normalizes to `cliproxyapi`). IDs use lowercase alphanumeric characters, dots, underscores, and hyphens (`[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?`).\n  - Model ID derives from the filename stem `{model}.yml`. This exact model ID is used for execution and selection. If specified in YAML, `model:` must match the filename stem.\n- **Provider Connection Agreement**: Every model file is self-contained. All files within a provider directory must agree on provider-level settings (`baseUrl`, `apiKey`, `env`, `transport`, `providerOptions`, `providerDisplayName` / `name`, `providerEnabled` / `enabled`).\n- **Environment-Reference Credentials**: Credentials (`apiKey`, `env`, or nested `options.apiKey`) must use uppercase environment variable references (e.g. `apiKey: $CODEX_LB_API_TOKEN`, `env: [$SUBS_CONTENTOREN_DE_API_KEY]`). Literal secret values are never committed or exposed via API responses; secrets resolve at execution time from server environment variables.\n- **Transports and Disabled Models**: Supported transports are `openai/completions` and `openai/responses`. Other transport metadata, including `aisdk` and `anthropic/messages`, remains cataloged, but models using those transports are disabled for execution and selection until a matching adapter exists. Models explicitly set to `enabled: false` / `disabled: true` are also disabled.\n- **Model Metadata**:\n  - `name`: Display name (defaults to the model ID).\n  - `family`: Optional model family string (e.g. `gpt-5.6`).\n  - `status`: Lifecycle status (`active`, `alpha`, `beta`, `deprecated`; defaults to `active`).\n  - `reasoning`: Boolean indicating reasoning capability.\n  - `limit`: Context window and output limits (e.g. `context: 272000`, `output: 128000`, optional `input`).\n  - `modalities` / `capabilities`: Modality arrays for `input` and `output` (e.g. `[text, image]`), and `tools` boolean.\n  - `cost`: Tiered pricing array with `input`, `output`, `cacheRead`, `cacheWrite`, and optional context tier (`tier: { type: \"context\", size: 200000 }`).\n  - `variants`: Array of model variants defining reasoning effort (`minimal`, `low`, `medium`, `high`, `xhigh`, `max`) and variant-specific `options`.\n\n### Agent Catalog (`agents/{name}.md`)\n\n- **ID and File Naming**: Agent ID derives from the filename stem `agents/{name}.md`.\n- **Frontmatter**:\n  - `description`: Agent purpose and role summary.\n  - `mode`: `primary` (direct implementation) or `subagent` (delegated execution; default).\n  - `model`: Model reference (e.g. `codex-lb/gpt-5.6-sol` or `gpt-5.6-luna`). If omitted, inherits the project catalog default.\n  - `provider`: Optional provider ID override.\n  - `variant` / `effort`: Model variant or reasoning effort choice (`low`, `medium`, `high`, `xhigh`, `max`).\n  - `permission`: Bounded nested permission rules (`allow`, `ask`, `deny`) for actions like `task` and `question`.\n  - `generation`: Optional transport-supported generation parameters (e.g. `reasoningEffort`). Stale or unsupported generation defaults (such as arbitrary `maxTokens: 100000` or `temperature: 0.7`) are omitted.\n  - `enabled`: Boolean availability (defaults to `true`).\n- **Markdown Body**: The non-empty system prompt defining the agent's instructions, role, and workflow.\n\n### UI Grouped Selector Behavior\n\nThe session model selector organizes available models into non-selectable provider group headers (e.g. `codex-lb`, `cliproxyapi`) with selectable model items underneath. Reasoning effort controls dynamically populate choices based on the selected model's configured `variants`.\n\n### Deterministic Seed and Reconcile\n\nCatalog models and agents are deterministically loaded, SHA-256 revisioned, and compiled into the Git-backed configuration store under `example-server-local` during seeding:\n\n```bash\nbun run db:seed\n```\n\n## Local Development\n\nRequirements: Bun 1.3 or newer, rootless Podman with a working Compose provider, and `git`.\n\nThe Codeline wrapper uses Podman's default rootless storage and does not set project-specific `--root` or `--runroot` paths. On this development host those defaults are `/home/david/.local/share/containers/storage` and `/run/user/1001/containers`; no Codeline Podman state is created under `/tmp`.\n\n```bash\nbun install\ncp .env.example .env\nchmod 600 .env\n# Replace the local password/admin placeholders in .env. Keep all real values there.\n./ops/dev/git-store-link.sh setup\n./ops/dev/zero-link.sh setup\n./ops/dev/codeline-dev.sh config\n./ops/dev/codeline-dev.sh build\n./ops/dev/codeline-dev.sh up\n./ops/dev/codeline-dev.sh migrate\n./ops/dev/codeline-dev.sh status\nbun run dev\n```\n\nProject discovery roots are configured with `CODELINE_PROJECT_ROOTS` as a JSON string array. Omit the variable, or leave it blank, to discover projects from the operating-system home directory. Set it to an explicit empty array (`[]`) to disable project discovery. Relative roots are normalized from the Codeline process working directory and duplicate roots are removed.\n\nFor example, configure multiple roots with:\n\n```dotenv\nCODELINE_PROJECT_ROOTS=[\"./projects\",\"../shared-projects\"]\n```\n\nServices use an isolated `codeline-dev` network and named volumes (`codeline-dev-postgres` and `codeline-dev-zero`). The managed host listeners are UI `127.0.0.1:6000`, API `127.0.0.1:6001`, PostgreSQL `127.0.0.1:6002`, and Zero sync `http://127.0.0.1:6003`. PostgreSQL and Zero retain their upstream-required container ports `5432` and `4848`; the Vite server proxies `/api` to `http://127.0.0.1:6001`.\n\nPostgres starts with logical replication enabled (`wal_level=logical`, 10 replication slots, and 10 WAL senders). Zero waits for the Postgres health check, persists its SQLite replica in its named volume, and exposes `/` as its health check. Migrations stay on a separate command so schema changes remain owned by Drizzle.\n\nSet up or verify the local Zero link without using registry Zero:\n\n```bash\n./ops/dev/zero-link.sh setup\n./ops/dev/zero-link.sh verify\n```\n\nAfter cloning, run `./ops/dev/zero-link.sh setup` from a Codeline checkout. `ZERO_CHECKOUT` in `.env` selects the pinned Zero checkout and defaults to `/home/david/opensource/zero`. Setup builds `packages/zero` with `pnpm@11.11.0`, registers that public package with Bun, and links `@rocicorp/zero` into Codeline. Setup and verify are idempotent.\n\nThis is intentionally the latest local Zero workflow. It is not reproducible from a clean clone or CI yet; that work is deferred. `ops/dev/zero-pkgs/` remains ignored for old local artifacts but is not used.\n\nSet up or verify the local git-store link:\n\n```bash\nbun run git-store:link\nbun run git-store:verify\n```\n\nThe link script installs and builds the clean sibling checkout at `../git-store-clean-779c05b`, runs `bun link` in that checkout, and links `@adaptive-ds/git-store` into Codeline. Set `GIT_STORE_CHECKOUT` in the environment or ignored `.env` to use another local checkout. Configuration writes always use `autoPush: false`; this setup does not add or use remote pushes.\n\nLike the Zero link, this is a local-checkout workflow and is not reproducible from a clean Codeline clone or CI. A clean clone needs the git-store checkout, its built `dist/`, and the local Bun link before Codeline dependencies and checks can resolve.\n\nVerify the immutable release inputs without network access:\n\n```bash\nbun run release:inputs:verify\n```\n\nThis checks the pinned Bun version, linked package targets, Git revisions and cleanliness, package identities and exports, and required build outputs. It reports a blocker when a provisioned source directory cannot prove its Git provenance.\n\nGitHub release artifacts and clean-clone/CI dependency reproducibility are deferred. Typecheck, tests, build, database checks, and release-input verification remain local commands after the Zero and git-store links are established.\n\nService lifecycle:\n\n```bash\n./ops/dev/codeline-dev.sh up\n./ops/dev/codeline-dev.sh start\n./ops/dev/codeline-dev.sh stop\n./ops/dev/codeline-dev.sh status\n./ops/dev/codeline-dev.sh logs zero-cache\n./ops/dev/codeline-dev.sh down\n./ops/dev/codeline-dev.sh reset\n./ops/dev/codeline-dev.sh clean\n```\n\n`down` removes containers but keeps data. `reset` also removes both named volumes and is the destructive local reset. Run `migrate` after `up` and after any new migration generation:\n\n```bash\n./ops/dev/codeline-dev.sh migrate\nbun run db:generate\n./ops/dev/codeline-dev.sh migrate\n```\n\nSeed deterministic local example data through the repository-owned command. It applies Drizzle migrations first, reconciles the local-development user, two servers, three fixture agents, active and archived sessions, and finalized messages, and reconciles catalog provider models and agents from `providers/` and `agents/` into the Git-backed configuration store under `example-server-local`. Repeated default runs preserve unrelated rows; `--reset` removes and recreates only the known fixture-owned rows.\n\n```bash\nbun run db:seed\nbun run db:seed -- --reset\n```\n\nUse the managed systemd user target for database, Zero, API, and UI verification. Do not start replacement services for seeding or browser checks:\n\n```bash\n./ops/dev/systemd/codeline-dev-systemd.sh status\nsystemctl --user restart codeline-dev.target\nbun run db:seed\n```\n\nFor repository-managed development startup, install and enable the user target:\n\n```bash\n./ops/dev/systemd/codeline-dev-systemd.sh install\nsystemctl --user enable --now codeline-dev.target\n./ops/dev/systemd/codeline-dev-systemd.sh status\n```\n\nThe target starts PostgreSQL before Zero Cache, then the Bun/Hono API on port `6001`, and finally the Vite UI on port `6000`. It waits for dependency health, API readiness at `/api/ready`, and the UI root; Vite's strict port check makes a UI port conflict fail the managed UI unit. The services load the ignored `.env`, run from the repository root, and restart on failure. It uses the user's default rootless Podman storage; it does not create Codeline-specific `/tmp` or `--root`/`--runroot` paths. Stop or remove it with `systemctl --user stop codeline-dev.target` or `./ops/dev/systemd/codeline-dev-systemd.sh remove`.\n\nTroubleshooting:\n\n- If configuration validation reports a missing variable, ensure `.env` exists and contains the required names from `.env.example`. The wrapper reports names only, never values.\n- If `podman compose` is unavailable, install or configure a Podman Compose provider and retry `./ops/dev/codeline-dev.sh config`.\n- If managed host ports `6000` through `6003` are busy, change the corresponding host variables in ignored `.env` and `DATABASE_URL`. Keep `VITE_ZERO_*`, `ZERO_QUERY_URL`, and `ZERO_MUTATE_URL` derived from `PUBLIC_ORIGIN`. Then reinstall/reload the user units.\n- If Zero retains a stale replica after schema or database experiments, run `./ops/dev/codeline-dev.sh clean`, then start the managed target and remigrate/reseed.\n- Inspect `./ops/dev/codeline-dev.sh logs postgres` and `./ops/dev/codeline-dev.sh logs zero-cache` for service diagnostics.\n\nExample route checks:\n\n```bash\ncurl http://127.0.0.1:6001/health\ncurl http://127.0.0.1:6001/api/sessions\ncurl -X POST http://127.0.0.1:6001/api/testing/echo \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"message\":\"hello\"}'\ncurl -N 'http://127.0.0.1:6001/api/testing/stream?scenario=normal'\n```\n\nUseful commands:\n\n```bash\nbun run format\nbun run format:check\nbun run typecheck\nbun run test\nbun run build\nbun run db:check\nbun run release\n```\n\nCopy `.env.example` to `.env` only when configuring local application work. The checked-out `.env` is ignored and contains generated local-only values; it contains no external credentials.\n\n## Roadmap\n\nNear-term work is release-readiness verification: documentation, local package validation, and automated end-to-end checks for the managed development services and protected application flows.\n\nGitHub release artifacts, clean-clone/CI reproducibility for the local Zero and git-store links, and production deployment automation are intentionally deferred. Pi-web exclusions remain out of scope.\n\n## License\n\nMIT. See [LICENSE](./LICENSE).\n","readmeFilename":"README.md","_rev":"1-e7299b3e9d2643fd0e0c53dc9ce3e621"}