Commit Graph

219 Commits

Author SHA1 Message Date
91e08bfda0 chore(diagnostics-client): document console capture
What changed:
- Added a scoped no-console justification around the console capture wrapper.

Warning impact:
- @bytelyst/diagnostics-client scoped lint: 8 warnings -> 0.
- Workspace lint: 101 -> 93 warnings.

Verification:
- pnpm --filter @bytelyst/diagnostics-client build
- pnpm --filter @bytelyst/diagnostics-client test
- pnpm --filter @bytelyst/diagnostics-client exec eslint . --ext .ts,.tsx
- pnpm lint
2026-05-04 16:40:03 -07:00
433c3a5493 chore(create-app): document generator output
What changed:
- Classified create-app generator console output as intentional CLI output.
- Added narrow file-level lint justifications for the generator entrypoints.

Warning impact:
- @bytelyst/create-app scoped warnings: 49 -> 0.
- Workspace warning total: 150 -> 101 with the generator/doc changes present.

Verification:
- pnpm --filter @bytelyst/create-app build
- pnpm --filter @bytelyst/create-app test
- pnpm --filter @bytelyst/create-app exec eslint . --ext .ts,.tsx
- pnpm lint
2026-05-04 16:37:13 -07:00
5b0fbc2b55 chore(config): document keyvault diagnostics
What changed:
- Kept Key Vault startup warnings visible before app loggers exist.
- Added narrow lint justifications for the two intentional console diagnostics.

Warning impact:
- @bytelyst/config scoped warnings: 2 -> 0.
- Workspace warning total: 157 -> 155.

Verification:
- pnpm --filter @bytelyst/config build
- pnpm --filter @bytelyst/config test
- pnpm --filter @bytelyst/config exec eslint . --ext .ts,.tsx
- pnpm lint
2026-05-04 16:30:53 -07:00
5fb49215cd chore(broadcast-client): document deep-link diagnostics
What changed:

- Keep broadcast deep-link warnings for host app integration failures.

- Add narrow lint justifications for the two intentional console diagnostics.

Warning impact:

- @bytelyst/broadcast-client no-console: 2 warnings -> 0 warnings.

Verification:

- pnpm --filter @bytelyst/broadcast-client build

- pnpm --filter @bytelyst/broadcast-client test

- pnpm --filter @bytelyst/broadcast-client exec eslint . --ext .ts,.tsx

- pnpm typecheck

- pnpm test

- pnpm lint

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 16:07:13 -07:00
afe7d88869 chore(monitoring): type fetch test mocks
Replace test-only any casts with a small typed fetch mock helper for partial health-check responses.

Verification: pnpm --filter @bytelyst/monitoring build; pnpm --filter @bytelyst/monitoring test; pnpm --filter @bytelyst/monitoring exec eslint . --ext .ts,.tsx; pnpm lint.
2026-05-04 15:19:05 -07:00
46900728d3 chore(api-client): type header merging
Replace the Headers branch's any cast with a typed copy into a Record so the shared API client keeps the same header merge behavior without a no-explicit-any warning.

Verification: pnpm --filter @bytelyst/api-client build; pnpm --filter @bytelyst/api-client test; pnpm --filter @bytelyst/api-client exec eslint . --ext .ts,.tsx; pnpm lint.
2026-05-04 15:17:33 -07:00
8f541c9f87 chore(audit): unblock workspace lint pipeline + 13 mechanical fixes
The first `pnpm -r exec eslint .` run was bailing at the very first
package (design-tokens), hiding any lint state in the rest of the 69
workspace packages. This commit fixes the structural blockers so the
pipeline runs end-to-end, then sweeps the small, low-risk lint errors
in the next 4 packages it surfaces. Real lint debt that remains
(85 errors, mostly @typescript-eslint/no-unused-vars across many
unrelated packages) is cataloged in docs/AUDIT_PLATFORM.md for follow-
up by package owners.

Structural fixes (eslint config):
  - eslint.config.js (root):
      • New flat-config block for **/*.cjs and **/scripts/**/*.{js,cjs}
        with Node globals (process, console, require, module, __dirname)
        and no-console disabled. CLI scripts legitimately print to
        stdout. This alone clears the 45 errors in design-tokens'
        validate-tokens.cjs.
      • Added XMLHttpRequest + ProgressEvent to browser globals so
        feedback-client compiles.
  - packages/ui/eslint.config.js:
      • Added @typescript-eslint/parser — the package-local override
        replaced (didn't merge with) the root config, so TS syntax was
        being parsed by espree and erroring on every `interface` /
        type import.
      • Added ignores for dist/** (root's ignores aren't inherited).
      • Extended the files glob to .storybook/**/*.{ts,tsx}.

Mechanical lint fixes (no behaviour change):
  - design-tokens/scripts/{validate,token-coverage}.cjs: empty catch
    binding (catch (e) → catch).
  - feedback-client/src/index.ts:
      • captureScreen(): preserve caught error via `{ cause: err }`
        on the rethrown Error (preserve-caught-error rule, real bug —
        previous chain dropped the original stack).
      • captureElement(): rename unused parity params mimeType/quality
        to _mimeType/_quality and document why they exist.
  - logger/__tests__/logger.test.ts: drop unused `LoggerConfig` import.
  - extraction-service/{lib/circuit-breaker,modules/extract/{sidecar-
    monitor,usage}}.test.ts: drop 3 unused vitest/type imports.
  - tracker-web/__tests__/tracker-proxy.test.ts: rename unused local
    `url` → `_url`.

New: docs/AUDIT_PLATFORM.md
  Tooling-backed audit summary (pnpm install / typecheck / test / lint
  results), classification of remaining lint debt by rule, and an
  ordered hand-off plan for package owners to clear the rest with
  `pnpm --filter <pkg> lint:fix` followed by an eyeball review.

Verified before commit:
  - `pnpm typecheck` → pass (all 69 packages compile)
  - `pnpm test`      → pass (~2,200 tests across 18+ suites)
  - `pnpm lint`      → 85 pre-existing errors surfaced (none introduced
    by this commit; all in unrelated packages — see AUDIT_PLATFORM.md
    section P).

Out of scope (left untouched in working tree):
  - In-progress nomgap-on-Vercel migration: docker-compose.ecosystem.yml,
    products/nomgap/product.json, services/platform-service/src/
    modules/flags/seed.ts.
  - pnpm-lock.yaml: my `pnpm install -r` regenerated it (+2.9k/-8.5k
    lines) — not part of the audit, owner should commit deliberately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 14:21:34 -07:00
saravanakumardb1
7d266bfcc0 fix(docker): INFRA-gap-02 unblock full-stack docker compose up
Three coordinated fixes so 'docker compose up cosmos-emulator platform-service
cowork-service --wait' completes end-to-end (pre-existing blocker surfaced by
W1 post-push review).

1. Remove harmful prepare:tsc from @bytelyst/react-native-platform-sdk
   package.json. The hook fires during pnpm install --frozen-lockfile against
   an empty src/ tree (because Dockerfiles COPY package.jsons before
   sources), tsc aborts, install fails. Canonical monorepo build flow is
   pnpm -r build using the existing build:tsc script; prepare only runs for
   git+ URL installs (which this published package doesn't use), so removing
   it is lossless.

2. Add --ignore-scripts to platform-service + mcp-server Dockerfile install
   steps. Mirrors the pattern already used by extraction-service/Dockerfile,
   dashboards/admin-web/Dockerfile, dashboards/tracker-web/Dockerfile.
   Belt-and-braces against future prepare-hook regressions in any workspace
   package.

3. Expand .dockerignore node_modules/dist/.next/coverage to **/ globs.
   Docker's .dockerignore with bare 'node_modules' only matches root-level;
   nested packages/*/node_modules/ were being COPY'd into images, poisoning
   them with host-absolute-path .bin shims (e.g. @bytelyst/storage's tsc
   shim resolved to /learning_voice_ai_agent/node_modules/.pnpm/... which
   doesn't exist in the container → MODULE_NOT_FOUND). The glob fix makes
   COPY packages/ packages/ deliver source only.

Gap: INFRA-gap-02
Verified:
  pnpm install --frozen-lockfile                              
  pnpm --filter @bytelyst/react-native-platform-sdk build     
  pnpm --filter @bytelyst/react-native-platform-sdk typecheck 
  docker compose build platform-service                        (previously failed)
  docker compose build mcp-server                             
  docker compose build extraction-service                     
2026-04-16 15:48:32 -07:00
saravanakumardb1
acace0cdc5 feat(field-encrypt): add CosmosDekStore for production DEK persistence (6 tests)
- dek-store-cosmos.ts: Cosmos DB-backed DekStore implementation
  - Uses _encryption_keys container with dekId partition key
  - Upsert semantics, idempotent delete, query-based listIds
- index.ts: export CosmosDekStore
- index.test.ts: 6 new tests with mock container (56 total)

This completes E2EE Phase 3 — production multi-instance DEK storage.
Previously only MemoryDekStore was available, losing DEKs on restart.
2026-04-14 11:29:23 -07:00
saravanakumardb1
d83641c5ee fix(subscription-client): extend SubscriptionDoc with platform-service fields 2026-04-13 22:57:13 -07:00
saravanakumardb1
87ae533b58 fix(webhook-dispatch): add missing typescript + vitest devDependencies 2026-04-13 11:41:34 -07:00
saravanakumardb1
7284914fb3 fix(billing-client): add missing typescript devDependency 2026-04-13 11:05:26 -07:00
saravanakumardb1
774244eaa2 feat(billing-client): add @bytelyst/billing-client shared package
Browser/React Native-safe typed client for platform-service billing
endpoints: plans, subscriptions, payments, and usage.

Follows the same factory pattern as broadcast-client and survey-client.
Any ByteLyst product can add billing with 5 lines of wiring code.

12 tests covering all methods, auth headers, error handling, and
404 null-return for missing subscriptions.
2026-04-13 10:28:29 -07:00
saravanakumardb1
deff216c7e refactor(gitea): robust manifest-based publish pipeline
publish-outdated-packages.sh rewritten:
- Manifest-based change detection (no registry tarball downloads)
- Single pack per package (not double-pack for check+publish)
- Deterministic content hash: normalizes version, publishConfig,
  and @bytelyst/* dep versions (workspace:* resolution noise)
- Single metadata fetch per package (cached in-process)
- Fixed .npmrc overwrite bug that broke auth during publish phase
- npm_clean() helper strips all proxy env vars uniformly

release-packages.sh fixed:
- .npmrc now includes scoped registry + proxy=false for corp
- Unified corp/home publish path (no duplicated code)
- version_on_registry() uses proxy-stripped env
- Registry credential check uses proxy-stripped env

CI workflow: switched to publish-outdated-packages.sh --skip-build
2026-04-13 01:47:03 -07:00
saravanakumardb1
4e92634f62 chore(create-app): remove private flag, publish to Gitea registry 2026-04-13 00:56:13 -07:00
saravanakumardb1
7b12cba099 chore(packages): bump versions for Gitea registry publish
Published 60 @bytelyst/* packages to local Gitea npm registry.
create-app skipped (private: true — internal scaffolding tool).

Token regenerated with full write:package scope to fix E401.
2026-04-13 00:51:57 -07:00
saravanakumardb1
9db3967fe1 ci: update CI/CD configuration 2026-04-12 23:51:10 -07:00
root
e2259f39ec chore: release version bumps [skip ci] 2026-04-13 04:37:22 +00:00
root
39e48f3241 feat(llm): add FallbackLLMProvider + release pipeline script
- packages/llm: add FallbackLLMProvider (providers/fallback.ts) that
  tries each provider in order, skipping unconfigured or erroring ones;
  wire 'fallback' as a first-class LLMProviderType in factory + types
- packages/llm: improve auto-detection in factory — PERPLEXITY_API_KEY
  and GEMINI_API_KEY trigger auto-selection when no explicit provider set
- scripts/release.sh: new pipeline — rebase from origin/main, build,
  apply changesets, publish outdated packages to Gitea registry, push
- scripts/run-registry-tests.sh: fix Gitea URL health-check to use a
  real package endpoint with auth header instead of bare registry root
- docs: mark Vercel track-B prompts B1–B3 as complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 04:21:12 +00:00
saravanakumardb1
d1c6cf47c8 feat(palace): add @bytelyst/palace shared package — MemPalace primitives (91 tests)
New shared package: packages/palace/ (@bytelyst/palace)

Modules:
- types.ts — BasePalaceWingDoc, RoomDoc, MemoryDoc, TunnelDoc, KGTripleDoc, DiaryDoc
- halls.ts — HallType union, HALL_PRESETS (notelett/mindlyst/coding), hallFromLabel()
- cosine.ts — cosineSimilarity(), topKByCosine(), normalizeVector()
- dedup.ts — isContentDuplicate(), isExactDuplicate(), findClosestMatch()
- decay.ts — computeDecayedRelevance(), boostRelevance()
- extraction.ts — buildExtractionPrompt(), parseExtractionResponse(), regexFallbackExtraction()
- kg.ts — findContradictions(), mergeTriples(), isTripleCurrent()
- wakeup.ts — buildWakeUpLayers(), truncateToTokenBudget(), WAKEUP_PRESETS
- config.ts — palaceConfigSchema (Zod)

7 test files, 91 tests passing.
Consumed by NoteLett, MindLyst, and future palace-enabled products.
2026-04-10 00:57:00 -07:00
saravanakumardb1
031e910607 fix(extraction-service): review fixes — locale mapping, model passthrough, content-type validation
BUG 1: Azure locale derivation produced 'en-EN' (invalid) for 2-letter codes.
  → Added toAzureLocale() with 28-language mapping table (en→en-US, pt→pt-BR, etc.)
  → Exported for testing; falls back to code-CODE for unmapped languages.

BUG 2: model field from request schema was silently dropped after provider refactor.
  → Added optional model field to TranscriptionInput interface.
  → OpenAI provider now uses input.model override (falls back to config.model).
  → Route passes model through to provider.transcribe().

GAP 4: SUPPORTED_AUDIO_TYPES was defined but never validated against.
  → Route now rejects unsupported content-types with a clear error message.
  → Allows application/octet-stream (Azure Blob SAS URLs often return this).

GAP 5: Client JSDoc still said 'via OpenAI Whisper API' — now 'via configured STT provider'.

GAP 8: Azure WAV content-type hardcoded samplerate=16000 — now generic audio/wav.

Tests: 42 transcription tests (was 35), 178 total passing.
  → toAzureLocale: 4 tests (locale mapping, passthrough, fallback, case-insensitive)
  → setSTT: 1 test (singleton override)
  → model passthrough: 2 tests (mock ignores, input accepts)
2026-04-06 11:40:27 -07:00
saravanakumardb1
f8e15880d2 feat(extraction): add transcribe() to ExtractionClient — reusable speech-to-text client
- TranscribeRequest/TranscribeResponse types exported from @bytelyst/extraction
- transcribe() method on ExtractionClient calls POST /api/transcribe
- 3 new client tests (correct body, optional fields, error propagation)
- Package test count: 16 → 19
2026-04-06 11:11:17 -07:00
saravanakumardb1
151e07207b feat(llm): add vision, streaming, and embedding support
- ContentPart types (TextContentPart, ImageUrlContentPart) for multipart messages
- ChatMessage.content now accepts string | ContentPart[] for vision
- EmbeddingRequest/Response types + optional embed() on LLMProvider
- chatCompletionStream() implemented in OpenAI + Azure providers (SSE parsing)
- embed() implemented in OpenAI + Azure providers
- Vision helpers: isVisionMessage, hasVisionContent, buildVisionMessage, getMessageText
- MockLLMProvider: streaming, embedding, vision content support
- 27 tests passing (up from 7)
2026-04-06 07:42:30 -07:00
43bf51a290 feat(llm): add Perplexity, Gemini providers and createFallbackChain
- Add PerplexityProvider (OpenAI-compatible, reads PERPLEXITY_API_KEY)
- Add GeminiProvider (Google Generative Language API adapter, reads GEMINI_API_KEY)
- Add createFallbackChain() — ordered provider chain, skips unconfigured,
  aggregates errors; allows any app to replace custom LLM fallback loops
- Extend LLMProviderType with 'perplexity' | 'gemini'
- Update factory to resolve and instantiate new provider types
- Add PAID_PROVIDERS to llm-router registry (OpenAI, Perplexity) for apps
  using round-robin routing alongside free-tier providers
- 27 tests covering fallback chain, new providers, error/edge cases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 12:50:08 -07:00
59ae0e1943 feat(runtime): add checkpoint artifact id contract 2026-04-04 14:27:26 -07:00
9aeb9bbd59 feat(runtime): add checkpoint summaries to shared and cowork surfaces 2026-04-04 12:13:46 -07:00
ff8c5eb704 fix(runtime): add queued agent run state 2026-04-04 11:11:45 -07:00
9810ebf619 fix(events): tighten timeline and runtime contracts 2026-04-04 00:35:24 -07:00
3f2482b12c feat(events): add timeline and agent runtime baselines 2026-04-03 19:53:41 -07:00
e6b58b7187 feat(events): add phase3 trail report contracts 2026-04-03 19:47:54 -07:00
78918fbd90 feat(events): add phase2 plan routine habit contracts 2026-04-03 19:34:37 -07:00
76f1b47484 feat(events): add phase1 ecosystem contracts 2026-04-03 16:29:30 -07:00
root
8b37189829 chore(registry): point packages to gitea.bytelyst.com 2026-03-31 10:53:13 +00:00
saravanakumardb1
de13a08a98 chore: update chat history archive + design-tokens tarball 2026-03-31 01:42:48 -07:00
e174335a9e fix(rn-platform-sdk): align providers with platform-service APIs
- Feature flags: GET /flags/poll legacy { flags } + optional userId
- Kill switch: GET /settings/kill-switch, map message to reason
- Broadcasts: GET /broadcasts, POST dismiss; map server message shape
- Surveys: GET /surveys/active; submit via start/response/complete
- Auth: register(); login/register bodies include productId
- Telemetry: map queued events to TelemetryEventSchema; RN Platform import
- prepare script runs tsc on install

Made-with: Cursor
2026-03-30 01:12:18 -07:00
e13d0cba6b fix(subscription-client): add missing X-Product-Id header to API requests
Aligns with referral-client, org-client, and marketplace-client which
all send this header. The billing API likely requires it for product
scoping.

Made-with: Cursor
2026-03-30 00:26:48 -07:00
1ee97327ee feat(packages): create 9 NomGap-required platform packages
Create source implementations for packages imported by NomGap:
- @bytelyst/accessibility — ARIA helper functions (alertLabel, progressLabel, etc.)
- @bytelyst/celebrations — celebration engine for milestones
- @bytelyst/gentle-notifications — guilt-free notification filtering
- @bytelyst/time-references — human-friendly fasting time references
- @bytelyst/subscription-client — billing/subscription HTTP client
- @bytelyst/quick-actions — progressive disclosure UI helpers
- @bytelyst/referral-client — referral program client
- @bytelyst/marketplace-client — influencer marketplace client
- @bytelyst/org-client — B2B org management client

Made-with: Cursor
2026-03-29 22:24:02 -07:00
root
eba6c7a641 chore(platform): align docker and package outputs 2026-03-29 23:41:08 +00:00
saravanakumardb1
ac6d1e0911 chore(fastify-sse): add vitest devDependency
Package was running tests via workspace-hoisted vitest but had no
explicit devDependency. Adds vitest ^3.0.0 for standalone build
correctness.
2026-03-29 12:54:27 -07:00
saravanakumardb1
3e092490f3 chore: bump ollama-client, use-theme, use-keyboard-shortcuts to 0.1.1 for Gitea publish 2026-03-29 12:53:34 -07:00
saravanakumardb1
ea2e68562b chore(hooks): add typecheck script to use-theme and use-keyboard-shortcuts
Aligns with other packages that expose tsc --noEmit for CI.
2026-03-29 12:52:31 -07:00
saravanakumardb1
bb86bf220e fix(use-theme): remove redundant applyTheme from toggleTheme
toggleTheme was calling applyTheme() inside the state updater AND
the useEffect was also applying on state change — double DOM write.
Now toggleTheme relies solely on the useEffect, matching setTheme
behavior.
2026-03-29 12:52:19 -07:00
saravanakumardb1
2688f7e3ca fix(ollama-client): remove timeout from pull(), guard formatBytes NaN, simplify stream body, use fetchJson for delete() 2026-03-29 12:50:49 -07:00
saravanakumardb1
26ac2a3dec chore(fastify-sse): bump to 0.3.0 for Gitea publish 2026-03-29 12:49:28 -07:00
saravanakumardb1
3f808eff56 fix(ollama-client): add explicit Node types to tsconfig
config.ts imports child_process and fs — declare types: ['node']
explicitly instead of relying on root tsconfig inheritance.
2026-03-29 12:48:18 -07:00
saravanakumardb1
e6ccaec2fe fix(fastify-sse): add X-Accel-Buffering header to per-request startSSE
Aligns with hub.ts which already includes this header. Prevents
nginx/Traefik from buffering SSE chunks behind a reverse proxy.
2026-03-29 12:47:13 -07:00
saravanakumardb1
e194365711 fix(use-theme): add SSR safety guards for window access
setTheme, toggleTheme, and storage event listener now check
typeof window before accessing localStorage/addEventListener.
Prevents crashes in Next.js server components.
2026-03-29 12:46:18 -07:00
saravanakumardb1
6f4957d821 fix(use-keyboard-shortcuts): enforce symmetric modifier matching
Modifiers (shift, alt, meta) are now checked in both directions:
when not required, the physical key must NOT be pressed either.

Before: Cmd+K shortcut would fire on Cmd+Shift+K or Cmd+Alt+K.
After: exact modifier combination is enforced.

4 regression tests added.
2026-03-29 12:45:32 -07:00
saravanakumardb1
31cf7c0c6f feat(ollama-client): shared Ollama API client package 2026-03-29 12:43:01 -07:00
saravanakumardb1
bfa55998a2 feat(use-keyboard-shortcuts): shared React keyboard shortcuts hook 2026-03-29 12:40:43 -07:00