managarten/packages/shared-ai/src
Till JS 0077752456 fix(type-check): clear the last five failures — monorepo type-check is now 76/76 green
After the mobile-app deletion unblocked \`@context/mobile\`, five more
pre-existing failures surfaced across shared packages and two services.
All were silent-masked by the postinstall \`|| true\` for months.

- **shared-ai**: \`planner/loop.ts\` imported \`ToolSchema\` from
  \`../tools/function-schema\`, which only imports (not re-exports) the
  type. Fixed to import from the source (\`../tools/schemas\`).
- **shared-logger**: \`typeof window !== 'undefined'\` blows up under
  tsconfigs that don't include the DOM lib (e.g. uload-server's
  \`bun-types\`-only config), because shared-logger is consumed via
  source import. Replaced with a \`globalThis\`-indirected check that
  compiles under any lib configuration.
- **shared-hono**: \`credits.ts\` returned \`res.json()\` directly as
  \`Promise<T | null>\`. Modern \`@types/node\` / undici types return
  \`unknown\` strictly — cast to \`T\` at the boundary so the generic
  contract is explicit.
- **uload-server**: \`routes/analytics.ts\` + \`routes/email.ts\` still
  imported \`AuthUser\` from a \`middleware/jwt-auth\` module that was
  deleted during the migration to \`@mana/shared-hono\`. Replaced with
  \`AuthVariables\` from shared-hono, which matches the actual context
  shape set by \`authMiddleware()\`.
- **manavoxel/web**: \`guestSeed\` collection entries were wrapped in
  arrow functions, but \`local-store\` expects \`T[]\` directly and
  iterates \`seed.length\` — which on a function is 0. The "guest
  seed" was silently dead; eager-evaluating \`generateGuestWorld()\`
  once and sharing the result fixes both the type and the runtime.

Verified: \`pnpm run type-check\` from the repo root now exits 0 —
76/76 tasks successful, no failures. First fully green state since
well before the postinstall \`|| true\` was introduced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 15:53:07 +02:00
..
agents chore: clear svelte-check errors + document scene-scope pattern 2026-04-18 17:24:52 +02:00
guardrails feat(ai): guardrail layer — pre/post-plan + pre-execute checks 2026-04-16 15:11:34 +02:00
missions feat(agents): Agent CRUD + default bootstrap + Mission.agentId (Phase 2) 2026-04-15 20:35:49 +02:00
planner fix(type-check): clear the last five failures — monorepo type-check is now 76/76 green 2026-04-20 15:53:07 +02:00
policy refactor(ai): dynamic tool registry — single-source catalog in shared-ai 2026-04-16 13:06:07 +02:00
tools feat(shared-ai): toolToFunctionSchema — catalog → OpenAI function-spec 2026-04-20 15:24:36 +02:00
actor.test.ts refactor(actor): identity-aware Actor for Multi-Agent Workbench (Phase 1) 2026-04-15 20:13:57 +02:00
actor.ts refactor(actor): identity-aware Actor for Multi-Agent Workbench (Phase 1) 2026-04-15 20:13:57 +02:00
index.ts feat(shared-ai): runPlannerLoop + compact system prompt for function calling 2026-04-20 15:31:01 +02:00