Skip to content

refactor(imports): direct subpath imports — PR D: Web AI + Integrations - #1091

Merged
2witstudios merged 4 commits into
masterfrom
barrel/web-ai
Apr 24, 2026
Merged

2witstudios merged 4 commits into
masterfrom
barrel/web-ai

Conversation

@2witstudios

@2witstudios 2witstudios commented Apr 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Replaces barrel imports with direct subpath imports across the AI and integrations subsystem of apps/web:

  • `apps/web/src/app/api/ai/**` — AI API routes and tests (chat, completions, tools)
  • `apps/web/src/lib/ai/**` — AI provider setup, tool definitions, stream handlers
  • `apps/web/src/app/api/agents/**` — agent API routes
  • `apps/web/src/app/api/integrations/**` — integration API routes
  • `apps/web/src/lib/integrations/**` — GitHub, Calendar, OAuth integration libraries
  • `apps/web/src/lib/mcp/**` — Model Context Protocol handlers
  • `apps/web/src/lib/memory/**` — agent memory management
  • `apps/web/src/lib/workflows/**` — workflow execution and task triggers

115 files total — all mechanical import-path swaps. No logic changes.

Context

PR D of 6 in the barrel-import removal series.

⚠️ Depends on PR A (#1088) `barrel/foundation` being merged first.
Base branch is `barrel/foundation` so CI resolves the new subpath exports.
After A merges, this PR's base will be updated to `master`.

PRs B, C, D, E1, E2 are independent of each other and can be reviewed/merged in any order after A lands.

Why AI is grouped together

AI tools, integrations, MCP, and workflows form a coherent subsystem. Grouping them lets reviewers verify the tool-call chain, integration OAuth flows, and workflow triggers as a unit.

Review fixes applied (post-review commits)

Two review passes found a total of 9 mock/source mismatches — all fixed:

Pass 1 fixes (34f82b9):

  1. mcp-scope.test.ts — malformed logger mock: logger was embedded inside child() return value instead of exported at the module top level
  2. agents/integrations/__tests__/route.test.ts — createGrant/findGrant still mocked at the barrel; moved to grant-repository subpath mock to match source imports
  3. ollama/models/__tests__/route.test.ts — validateLocalProviderURL mock path not updated from @pagespace/lib/security to /security/url-validator
  4. calendar-write-tools.test.ts — mock path updated but import statement left pointing at barrel @pagespace/lib
  5. page-read-tools.test.ts — dead @pagespace/lib/server stubs removed (source no longer imports from that path)

Also added 74 missing trailing semicolons to subpath import statements across 45 source files.

Pass 2 fixes (1799bcd):
6. mcp-bridge.test.ts — mock path was /logging/logger-config but source imports from /logging/logger; these are different modules (logger = root Winston instance, loggers = named namespaces)
7. page-read-tools.test.ts — /content/page-types.config mock had wrong function names (isDocumentPage, isAIChatPage, getCreatablePageTypes) carried over from old barrel mock; source uses getPageTypeEmoji and isFolderPage
8. agent-tools.test.ts — missing semicolon on import statement
9. page-write-tools.test.ts — missing semicolon on import statement

@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 1 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 16 minutes and 1 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c24c1b1-6b9e-450d-ad55-8e5f66a30055

📥 Commits

Reviewing files that changed from the base of the PR and between 7d49bef and 48c64a9.

📒 Files selected for processing (115)
  • apps/web/src/app/api/agents/[agentId]/integrations/[grantId]/__tests__/route.test.ts
  • apps/web/src/app/api/agents/[agentId]/integrations/[grantId]/route.ts
  • apps/web/src/app/api/agents/[agentId]/integrations/__tests__/route.test.ts
  • apps/web/src/app/api/agents/[agentId]/integrations/route.ts
  • apps/web/src/app/api/ai/abort/__tests__/route.test.ts
  • apps/web/src/app/api/ai/abort/route.ts
  • apps/web/src/app/api/ai/chat/__tests__/mcp-scope.test.ts
  • apps/web/src/app/api/ai/chat/messages/[messageId]/__tests__/route.test.ts
  • apps/web/src/app/api/ai/chat/messages/[messageId]/route.ts
  • apps/web/src/app/api/ai/chat/messages/[messageId]/undo/__tests__/route.test.ts
  • apps/web/src/app/api/ai/chat/messages/[messageId]/undo/route.ts
  • apps/web/src/app/api/ai/chat/messages/__tests__/mcp-scope.test.ts
  • apps/web/src/app/api/ai/chat/messages/__tests__/route.test.ts
  • apps/web/src/app/api/ai/chat/messages/route.ts
  • apps/web/src/app/api/ai/chat/route.ts
  • apps/web/src/app/api/ai/global/[id]/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/[id]/messages/[messageId]/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/[id]/messages/[messageId]/route.ts
  • apps/web/src/app/api/ai/global/[id]/messages/route.ts
  • apps/web/src/app/api/ai/global/[id]/route.ts
  • apps/web/src/app/api/ai/global/[id]/usage/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/[id]/usage/route.ts
  • apps/web/src/app/api/ai/global/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/active/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/active/route.ts
  • apps/web/src/app/api/ai/global/route.ts
  • apps/web/src/app/api/ai/lmstudio/models/__tests__/route.test.ts
  • apps/web/src/app/api/ai/lmstudio/models/route.ts
  • apps/web/src/app/api/ai/ollama/models/__tests__/route.test.ts
  • apps/web/src/app/api/ai/ollama/models/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/config/__tests__/route.test.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/config/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/[conversationId]/__tests__/route.test.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/[conversationId]/messages/[messageId]/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/[conversationId]/messages/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/[conversationId]/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/__tests__/route.test.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/route.ts
  • apps/web/src/app/api/ai/page-agents/consult/route.ts
  • apps/web/src/app/api/ai/page-agents/create/__tests__/route.test.ts
  • apps/web/src/app/api/ai/page-agents/create/route.ts
  • apps/web/src/app/api/ai/page-agents/multi-drive/route.ts
  • apps/web/src/app/api/ai/settings/__tests__/route.test.ts
  • apps/web/src/app/api/ai/settings/route.ts
  • apps/web/src/app/api/integrations/connections/[connectionId]/grants/route.ts
  • apps/web/src/app/api/integrations/google-calendar/calendars/route.ts
  • apps/web/src/app/api/integrations/google-calendar/callback/__tests__/route.test.ts
  • apps/web/src/app/api/integrations/google-calendar/callback/route.ts
  • apps/web/src/app/api/integrations/google-calendar/connect/route.ts
  • apps/web/src/app/api/integrations/google-calendar/disconnect/route.ts
  • apps/web/src/app/api/integrations/google-calendar/settings/route.ts
  • apps/web/src/app/api/integrations/google-calendar/status/route.ts
  • apps/web/src/app/api/integrations/google-calendar/sync/route.ts
  • apps/web/src/app/api/integrations/google-calendar/webhook/__tests__/route.test.ts
  • apps/web/src/app/api/integrations/google-calendar/webhook/route.ts
  • apps/web/src/app/api/integrations/providers/[providerId]/route.ts
  • apps/web/src/app/api/integrations/providers/available/route.ts
  • apps/web/src/app/api/integrations/providers/import-openapi/route.ts
  • apps/web/src/app/api/integrations/providers/install/route.ts
  • apps/web/src/app/api/integrations/providers/route.ts
  • apps/web/src/lib/ai/core/__tests__/integration-tool-resolver.test.ts
  • apps/web/src/lib/ai/core/__tests__/mention-processor.test.ts
  • apps/web/src/lib/ai/core/__tests__/provider-factory.test.ts
  • apps/web/src/lib/ai/core/agent-awareness.ts
  • apps/web/src/lib/ai/core/ai-utils.ts
  • apps/web/src/lib/ai/core/integration-tool-resolver.ts
  • apps/web/src/lib/ai/core/mention-processor.ts
  • apps/web/src/lib/ai/core/message-utils.ts
  • apps/web/src/lib/ai/core/model-capabilities.ts
  • apps/web/src/lib/ai/core/page-tree-context.ts
  • apps/web/src/lib/ai/tools/__tests__/activity-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/agent-communication-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/agent-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/calendar-read-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/calendar-write-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/channel-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/drive-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/page-read-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/page-write-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/search-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/task-management-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/web-search-tools.test.ts
  • apps/web/src/lib/ai/tools/activity-tools.ts
  • apps/web/src/lib/ai/tools/agent-communication-tools.ts
  • apps/web/src/lib/ai/tools/agent-tools.ts
  • apps/web/src/lib/ai/tools/calendar-read-tools.ts
  • apps/web/src/lib/ai/tools/calendar-write-tools.ts
  • apps/web/src/lib/ai/tools/channel-tools.ts
  • apps/web/src/lib/ai/tools/drive-tools.ts
  • apps/web/src/lib/ai/tools/page-read-tools.ts
  • apps/web/src/lib/ai/tools/page-write-tools.ts
  • apps/web/src/lib/ai/tools/search-tools.ts
  • apps/web/src/lib/ai/tools/task-management-tools.ts
  • apps/web/src/lib/ai/tools/web-search-tools.ts
  • apps/web/src/lib/integrations/google-calendar/__tests__/map-attendees.test.ts
  • apps/web/src/lib/integrations/google-calendar/__tests__/sync-service.test.ts
  • apps/web/src/lib/integrations/google-calendar/api-client.ts
  • apps/web/src/lib/integrations/google-calendar/push-service.ts
  • apps/web/src/lib/integrations/google-calendar/sync-service.ts
  • apps/web/src/lib/integrations/google-calendar/token-refresh.ts
  • apps/web/src/lib/integrations/google-calendar/webhook-token.ts
  • apps/web/src/lib/mcp/__tests__/mcp-bridge.test.ts
  • apps/web/src/lib/mcp/mcp-bridge.ts
  • apps/web/src/lib/memory/__tests__/compaction-service.test.ts
  • apps/web/src/lib/memory/__tests__/discovery-service.test.ts
  • apps/web/src/lib/memory/__tests__/integration-service.test.ts
  • apps/web/src/lib/memory/compaction-service.ts
  • apps/web/src/lib/memory/discovery-service.ts
  • apps/web/src/lib/memory/integration-service.ts
  • apps/web/src/lib/workflows/__tests__/calendar-trigger-executor.test.ts
  • apps/web/src/lib/workflows/__tests__/task-trigger-helpers.test.ts
  • apps/web/src/lib/workflows/__tests__/workflow-executor.test.ts
  • apps/web/src/lib/workflows/calendar-trigger-executor.ts
  • apps/web/src/lib/workflows/task-trigger-helpers.ts
  • apps/web/src/lib/workflows/workflow-executor.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch barrel/web-ai

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac09912fbb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/lib/mcp/mcp-bridge.ts Outdated
@2witstudios

Copy link
Copy Markdown
Owner Author

Code Review: PR #1091 — barrel/web-ai import decomposition

Scope: Mechanical decomposition of @pagespace/lib, @pagespace/lib/server, @pagespace/lib/integrations, @pagespace/lib/permissions, @pagespace/lib/security barrel imports into direct subpath imports across 44 source files and 26 test files in apps/web/.


✅ What's Correct

Source file decompositions — all verified clean

Every source-side import swap has been confirmed correct against the actual export map:

Domain Key decompositions
AI core loggers → /logging/logger-config; getUserDriveAccess → /permissions/permissions; buildTree → /content/tree-utils
AI tools (12 files) canUserEditPage/canUserViewPage → /permissions/permissions; logPageActivity/getActorInfo → /monitoring/activity-logger; pageRepository/driveRepository → /repositories
MCP bridge logger → /logging/logger (correct — uses root logger, not the namespaced loggers)
OAuth (Google Calendar) encrypt/decrypt → /encryption; secureCompare → /auth/secure-compare; maskEmail → /audit/mask-email
Memory services loggers → /logging/logger-config (3 files)
Workflows isUserDriveMember → /permissions/permissions; loggers → /logging/logger-config (3 files)

page-write-tools.ts — the most complex decomposition (13 identifiers from one barrel → 10 distinct subpaths) — is correct. No logic changes anywhere in the source files.

logger top-level key added consistently to logger-config mocks

Every test file that mocks @pagespace/lib/logging/logger-config now includes both loggers and logger in the factory return. That's correct: the real module exports both. Tests that only needed loggers were silently fine before; now they won't blow up if the source ever calls logger.child(...) directly.

Five bugs fixed from first review pass

All five confirmed fixed and clean in the final diff:

  1. mcp-scope.test.ts — logger key nested inside child() return, now correctly at module top level
  2. agents/[agentId]/integrations test — createGrant/findGrant moved from barrel mock to /repositories/grant-repository
  3. ollama/models test — validateLocalProviderURL mock moved to /security/url-validator
  4. calendar-write-tools.test.ts — import statement updated to match mock path
  5. page-read-tools.test.ts — dead @pagespace/lib/server block removed entirely

🐛 Two Remaining Bugs

Bug 1 — mcp-bridge.test.ts: mock intercepts the wrong module

File: apps/web/src/lib/mcp/__tests__/mcp-bridge.test.ts

Source after this PR:

import { logger } from '@pagespace/lib/logging/logger';

Test mock in this PR:

vi.mock('@pagespace/lib/logging/logger-config', () => ({
    logger: { child: vi.fn(() => ({ ... })) },
}));

Vitest intercepts by exact module path. Mocking /logging/logger-config does not intercept an import from /logging/logger — they are different modules. The mock silently fails to install. In the test environment, logger.child(...) will call the real implementation, which may not be initialized correctly.

Fix: Change the mock path to match the source import:

vi.mock('@pagespace/lib/logging/logger', () => ({
    logger: { child: vi.fn(() => ({ info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() })) },
}));

Bug 2 — page-read-tools.test.ts: mock exports the wrong function names

File: apps/web/src/lib/ai/tools/__tests__/page-read-tools.test.ts

Source after this PR (page-read-tools.ts):

import { getPageTypeEmoji, isFolderPage } from '@pagespace/lib/content/page-types.config';

Test mock in this PR:

vi.mock('@pagespace/lib/content/page-types.config', () => ({
    isDocumentPage: vi.fn((type) => type === 'DOCUMENT'),
    isAIChatPage: vi.fn((type) => type === 'AI_CHAT'),
    getCreatablePageTypes: vi.fn(() => ['FOLDER', ...]),
}));

The mock path is now correct, but the exported names are wrong. isDocumentPage, isAIChatPage, getCreatablePageTypes are not what page-read-tools.ts imports from this module. getPageTypeEmoji and isFolderPage are not in the factory, so they'll be undefined in tests. Any test path that invokes them will throw TypeError: getPageTypeEmoji is not a function.

These names were carried over from the old @pagespace/lib/server barrel mock, which bundled everything together — a typical migration artifact.

Fix: Replace with the functions the source actually uses:

vi.mock('@pagespace/lib/content/page-types.config', () => ({
    getPageTypeEmoji: vi.fn((type: string) => '📄'),
    isFolderPage: vi.fn((type: string) => type === 'FOLDER'),
}));

⚠️ Minor Style

Two import statements in test files are missing semicolons (inconsistent with the rest of the file):

  • apps/web/src/lib/ai/tools/__tests__/page-write-tools.test.ts: import { canUserEditPage } from '@pagespace/lib/permissions/permissions' ← no ;
  • apps/web/src/lib/ai/tools/__tests__/agent-tools.test.ts: import { canUserEditPage } from '@pagespace/lib/permissions/permissions' ← no ;

Summary

The mechanical import decomposition is correct across all 44 source files. The five bugs from the first review pass are cleanly fixed. Two new issues need resolution before merge: one mock that intercepts the wrong module entirely (mcp-bridge), and one mock that has the right path but wrong export names (page-read-tools). Both are the same class of bug — mock/source path misalignment — and both are straightforward one-liner fixes.

@2witstudios

Copy link
Copy Markdown
Owner Author

Fixed — all four issues from the review are now resolved in commit 1799bcd5e:

  1. mcp-bridge.test.ts — mock path corrected from @pagespace/lib/logging/logger-config to @pagespace/lib/logging/logger. Source imports logger (the root Winston instance) from /logging/logger; /logging/logger-config is a different module that exports loggers (the named namespaces). Mock now intercepts the correct module.

  2. page-read-tools.test.ts — /content/page-types.config mock now exports getPageTypeEmoji and isFolderPage (what the source actually imports and calls) instead of the stale isDocumentPage, isAIChatPage, getCreatablePageTypes carried over from the old barrel mock. The wrong names would have caused TypeError: getPageTypeEmoji is not a function in any test that exercises those code paths.

  3. agent-tools.test.ts — missing semicolon added to import { canUserEditPage } statement.

  4. page-write-tools.test.ts — missing semicolon added to import { canUserEditPage } statement.

Verified mcp-bridge.test.ts locally: 19/19 tests pass with the corrected mock path.

@2witstudios
2witstudios changed the base branch from barrel/foundation to master April 24, 2026 05:11
2witstudios and others added 4 commits April 24, 2026 00:16
…, workflows

Replaces barrel imports in the AI and integration subsystem of apps/web:
- apps/web/src/app/api/ai/** (routes + tests)
- apps/web/src/lib/ai/** (source + tests)
- apps/web/src/app/api/agents/**
- apps/web/src/app/api/integrations/**
- apps/web/src/lib/integrations/**
- apps/web/src/lib/mcp/**
- apps/web/src/lib/memory/**
- apps/web/src/lib/workflows/**

Part of the barrel-import removal series — PR D of 6. Depends on
barrel/foundation (#1088) being merged first.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
logger-config exports loggers (plural) helpers; the root logger instance
lives in logging/logger. Use the direct module for clarity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Test correctness fixes:
- mcp-scope.test.ts: fix malformed logger mock (logger was nested inside
  child() return instead of exported at module top level)
- agents/integrations/__tests__/route.test.ts: move createGrant and
  findGrant from barrel mock to grant-repository subpath mock — source
  imports from /repositories/grant-repository, not @pagespace/lib/integrations
- ollama/models/__tests__/route.test.ts: update validateLocalProviderURL
  mock path from @pagespace/lib/security to /security/url-validator
- calendar-write-tools.test.ts: update isUserDriveMember import from
  @pagespace/lib barrel to /permissions/permissions to match the mock path
- page-read-tools.test.ts: remove dead @pagespace/lib/server mock stubs
  for isChannelPage, formatContentForAI etc. — source no longer imports
  these from that path

Style: add missing trailing semicolons to 74 @pagespace/lib subpath
import statements across 45 source files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- mcp-bridge.test.ts: mock @pagespace/lib/logging/logger not logger-config;
  source imports logger from /logging/logger, these are different modules
- page-read-tools.test.ts: mock getPageTypeEmoji/isFolderPage not
  isDocumentPage/isAIChatPage/getCreatablePageTypes; wrong fn names carried
  over from barrel mock, actual imports are the emoji/folder helpers
- agent-tools.test.ts: add missing semicolon on import statement
- page-write-tools.test.ts: add missing semicolon on import statement

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@2witstudios
2witstudios merged commit 283f04d into master Apr 24, 2026
5 of 8 checks passed
2witstudios added a commit that referenced this pull request May 15, 2026
…ns (#1091)

* refactor(imports): use direct subpath imports in web AI, integrations, workflows

Replaces barrel imports in the AI and integration subsystem of apps/web:
- apps/web/src/app/api/ai/** (routes + tests)
- apps/web/src/lib/ai/** (source + tests)
- apps/web/src/app/api/agents/**
- apps/web/src/app/api/integrations/**
- apps/web/src/lib/integrations/**
- apps/web/src/lib/mcp/**
- apps/web/src/lib/memory/**
- apps/web/src/lib/workflows/**

Part of the barrel-import removal series — PR D of 6. Depends on
barrel/foundation (#1088) being merged first.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(web-ai): import logger from logging/logger not logging/logger-config

logger-config exports loggers (plural) helpers; the root logger instance
lives in logging/logger. Use the direct module for clarity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(web-ai): resolve mock/source mismatches + add missing semicolons

Test correctness fixes:
- mcp-scope.test.ts: fix malformed logger mock (logger was nested inside
  child() return instead of exported at module top level)
- agents/integrations/__tests__/route.test.ts: move createGrant and
  findGrant from barrel mock to grant-repository subpath mock — source
  imports from /repositories/grant-repository, not @pagespace/lib/integrations
- ollama/models/__tests__/route.test.ts: update validateLocalProviderURL
  mock path from @pagespace/lib/security to /security/url-validator
- calendar-write-tools.test.ts: update isUserDriveMember import from
  @pagespace/lib barrel to /permissions/permissions to match the mock path
- page-read-tools.test.ts: remove dead @pagespace/lib/server mock stubs
  for isChannelPage, formatContentForAI etc. — source no longer imports
  these from that path

Style: add missing trailing semicolons to 74 @pagespace/lib subpath
import statements across 45 source files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(web-ai): resolve 4 remaining mock/source mismatches from review

- mcp-bridge.test.ts: mock @pagespace/lib/logging/logger not logger-config;
  source imports logger from /logging/logger, these are different modules
- page-read-tools.test.ts: mock getPageTypeEmoji/isFolderPage not
  isDocumentPage/isAIChatPage/getCreatablePageTypes; wrong fn names carried
  over from barrel mock, actual imports are the emoji/folder helpers
- agent-tools.test.ts: add missing semicolon on import statement
- page-write-tools.test.ts: add missing semicolon on import statement

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@2witstudios
2witstudios deleted the barrel/web-ai branch May 27, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant