Skip to content
Closed
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
8 changes: 6 additions & 2 deletions frontend/apps/app/app/api/chat/replay/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import {
} from '@liam-hq/agent'
import { SSE_EVENTS } from '@liam-hq/agent/client'
import { toResultAsync } from '@liam-hq/db'
import { fromAsyncThrowable, fromValibotSafeParse } from '@liam-hq/neverthrow'
import {
errAsync,
fromAsyncThrowable,
fromValibotSafeParse,
okAsync,
} from '@liam-hq/neverthrow'
import * as Sentry from '@sentry/nextjs'
import { errAsync, okAsync } from 'neverthrow'
import { after, NextResponse } from 'next/server'
import * as v from 'valibot'
import { line } from '../../../../features/stream/utils/line'
Expand Down
6 changes: 5 additions & 1 deletion frontend/apps/app/app/api/github/token/refresh/route.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import {
err,
errAsync,
fromAsyncThrowable,
fromPromise,
fromValibotSafeParse,
ok,
okAsync,
type Result,
type ResultAsync,
} from '@liam-hq/neverthrow'
import * as Sentry from '@sentry/nextjs'
import { err, errAsync, ok, okAsync, type ResultAsync } from 'neverthrow'
import { NextResponse } from 'next/server'
import * as v from 'valibot'
import type { TokenPayload } from '../../../../../libs/github/cookie'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import {
type GitHubRepoInfo,
getFolderContents,
} from '@liam-hq/github'
import { fromThrowable } from '@liam-hq/neverthrow'
import { err, fromThrowable, ok, type Result } from '@liam-hq/neverthrow'
import { detectFormat } from '@liam-hq/schema/parser'
import { err, ok, type Result } from 'neverthrow'

const SECURITY_LIMITS = {
MAX_RECURSION_DEPTH: 5,
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/app/app/projects/new/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getInstallations } from '@liam-hq/github'
import { okAsync } from 'neverthrow'
import { okAsync } from '@liam-hq/neverthrow'
import { redirect } from 'next/navigation'
import { ProjectNewPage } from '../../../components/ProjectNewPage'
import { getOrganizationId } from '../../../features/organizations/services/getOrganizationId'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
getCheckpointErrors,
getMessages,
} from '@liam-hq/agent'
import { err, ok, type Result } from '@liam-hq/neverthrow'
import type { Schema } from '@liam-hq/schema'
import { schemaSchema } from '@liam-hq/schema'
import { err, ok, type Result } from 'neverthrow'
import { cookies } from 'next/headers'
import { type FC, Suspense } from 'react'
import { safeParse } from 'valibot'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
MessageTupleManager,
SSE_EVENTS,
} from '@liam-hq/agent/client'
import { err, ok, type Result } from 'neverthrow'
import { err, ok, type Result } from '@liam-hq/neverthrow'
import { useCallback, useMemo, useRef, useState } from 'react'
import { object, safeParse, string } from 'valibot'
import { useNavigationGuard } from '../../../../hooks/useNavigationGuard'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { toResultAsync } from '@liam-hq/db'
import { errAsync, okAsync, ResultAsync } from 'neverthrow'
import { errAsync, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import { createClient } from '../../../libs/db/server'
import { getOrganizationIdFromCookie } from './getOrganizationIdFromCookie'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { errAsync, okAsync, ResultAsync } from 'neverthrow'
import { errAsync, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import { cookies } from 'next/headers'
import { ORGANIZATION_ID_KEY } from '../constants'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { fromPromise } from '@liam-hq/neverthrow'
import { errAsync, type ResultAsync } from 'neverthrow'
import { errAsync, fromPromise, type ResultAsync } from '@liam-hq/neverthrow'

export const withTimeoutAndAbort = (
fn: (signal: AbortSignal) => Promise<void>,
Expand Down
6 changes: 3 additions & 3 deletions frontend/apps/app/hooks/usePublicShareServerAction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fromPromise } from 'neverthrow'
import { fromPromiseOriginal } from '@liam-hq/neverthrow'
import { useCallback, useEffect, useRef, useState, useTransition } from 'react'
import {
disablePublicShare,
Expand Down Expand Up @@ -35,11 +35,11 @@ export const usePublicShareServerAction = ({

setIsLoading(true)

const result = await fromPromise(
const result = await fromPromiseOriginal(
currentIsPublic
? disablePublicShare(designSessionId)
: enablePublicShare(designSessionId),
(error) => ({
(error): { success: false; error: string } => ({
success: false,
error:
error instanceof Error
Expand Down
3 changes: 2 additions & 1 deletion frontend/apps/app/libs/github/cookie.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// Server-only utility for encrypted GitHub tokens stored in HttpOnly cookies

import {
errAsync,
fromPromise,
fromThrowable,
okAsync,
type ResultAsync,
} from '@liam-hq/neverthrow'
import { decryptAesGcm, encryptAesGcm } from '@liam-hq/security/cryptoBox'
import { errAsync, okAsync } from 'neverthrow'
import { cookies } from 'next/headers'
import * as v from 'valibot'

Expand Down
1 change: 0 additions & 1 deletion frontend/apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"dotenv": "16.5.0",
"emoji-regex": "10.4.0",
"lucide-react": "0.511.0",
"neverthrow": "8.2.0",
"next": "15.4.7",
"react": "19.1.1",
"react-dom": "19.1.1",
Expand Down
1 change: 0 additions & 1 deletion frontend/internal-packages/agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"dotenv": "16.5.0",
"fast-json-patch": "3.1.1",
"langsmith": "0.3.73",
"neverthrow": "8.2.0",
"uuid": "11.1.0",
"valibot": "1.1.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { resolve } from 'node:path'
import { createClient, type SupabaseClientType } from '@liam-hq/db'
import type { Result } from '@liam-hq/neverthrow'
import { err, errAsync, ok, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import type { Schema } from '@liam-hq/schema'
import { config } from 'dotenv'
import type { Result } from 'neverthrow'
import { err, errAsync, ok, okAsync, ResultAsync } from 'neverthrow'
import { createSupabaseRepositories } from '../../src/repositories/factory'

// Load environment variables from ../../../../../.env and .env.local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { errAsync, okAsync, ResultAsync } from 'neverthrow'
import { errAsync, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import type { SetupDatabaseAndUserResult } from './scriptUtils'
import {
createBuildingSchema,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RunnableConfig } from '@langchain/core/runnables'
import { err, ok, type Result } from 'neverthrow'
import { err, ok, type Result } from '@liam-hq/neverthrow'
import * as v from 'valibot'
import type { Repositories } from '../repositories'
import { getConfigurable } from '../utils/getConfigurable'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {
SystemMessage,
} from '@langchain/core/messages'
import { ChatOpenAI } from '@langchain/openai'
import { fromAsyncThrowable } from '@liam-hq/neverthrow'
import { okAsync, ResultAsync } from 'neverthrow'
import { fromAsyncThrowable, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import * as v from 'valibot'
import { SSE_EVENTS } from '../streaming/constants'
import type { Reasoning } from '../types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RunnableConfig } from '@langchain/core/runnables'
import { Result } from '@liam-hq/neverthrow'
import { yamlSchemaDeparser } from '@liam-hq/schema'
import { Result } from 'neverthrow'
import { WorkflowTerminationError } from '../../utils/errorHandling'
import { getConfigurable } from '../../utils/getConfigurable'
import { removeReasoningFromMessages } from '../../utils/messageCleanup'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { BaseMessage } from '@langchain/core/messages'
import { ToolMessage } from '@langchain/core/messages'
import type { RunnableConfig } from '@langchain/core/runnables'
import { ToolNode } from '@langchain/langgraph/prebuilt'
import type { ResultAsync } from '@liam-hq/neverthrow'
import type { Schema } from '@liam-hq/schema'
import type { ResultAsync } from 'neverthrow'
import type { Repositories } from '../../repositories'
import { getConfigurable } from '../../utils/getConfigurable'
import type { DbAgentState } from '../shared/dbAgentAnnotation'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
} from '@langchain/core/messages'
import { END } from '@langchain/langgraph'
import { ChatOpenAI } from '@langchain/openai'
import type { ResultAsync } from '@liam-hq/neverthrow'
import { fromAsyncThrowable } from '@liam-hq/neverthrow'
import type { ResultAsync } from 'neverthrow'
import { SSE_EVENTS } from '../../streaming/constants'
import type { WorkflowState } from '../../types'
import { streamLLMResponse } from '../../utils/streamingLlmUtils'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
SystemMessage,
} from '@langchain/core/messages'
import { ChatOpenAI } from '@langchain/openai'
import { fromAsyncThrowable } from '@liam-hq/neverthrow'
import { okAsync, ResultAsync } from 'neverthrow'
import { fromAsyncThrowable, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import * as v from 'valibot'
import { SSE_EVENTS } from '../streaming/constants'
import type { Reasoning, WorkflowConfigurable } from '../types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RunnableConfig } from '@langchain/core/runnables'
import { Result } from '@liam-hq/neverthrow'
import { yamlSchemaDeparser } from '@liam-hq/schema'
import { Result } from 'neverthrow'
import { WorkflowTerminationError } from '../../utils/errorHandling'
import { getConfigurable } from '../../utils/getConfigurable'
import { invokePmAnalysisAgent } from '../invokePmAnalysisAgent'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { ToolMessage } from '@langchain/core/messages'
import type { RunnableConfig } from '@langchain/core/runnables'
import { type StructuredTool, tool } from '@langchain/core/tools'
import { Command } from '@langchain/langgraph'
import { fromValibotSafeParse } from '@liam-hq/neverthrow'
import { ok, type Result } from 'neverthrow'
import { fromValibotSafeParse, ok, type Result } from '@liam-hq/neverthrow'
import { v4 as uuidv4 } from 'uuid'
import * as v from 'valibot'
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { ToolMessage } from '@langchain/core/messages'
import type { RunnableConfig } from '@langchain/core/runnables'
import { type StructuredTool, tool } from '@langchain/core/tools'
import { Command, getCurrentTaskInput } from '@langchain/langgraph'
import { toAsync } from '@liam-hq/neverthrow'
import { ResultAsync } from 'neverthrow'
import { ResultAsync, toAsync } from '@liam-hq/neverthrow'
import { v4 as uuidv4 } from 'uuid'
import * as v from 'valibot'
import { SSE_EVENTS } from '../../streaming/constants'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { err, ok, type Result } from 'neverthrow'
import { err, ok, type Result } from '@liam-hq/neverthrow'

const PGTAP_FUNCTIONS = [
'lives_ok',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errAsync, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import { pgParse } from '@liam-hq/schema/parser'
import { errAsync, okAsync, ResultAsync } from 'neverthrow'

/**
* Validate SQL syntax using pgParse and return error message if validation fails
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { BaseCheckpointSaver } from '@langchain/langgraph-checkpoint'
import { MemorySaver } from '@langchain/langgraph-checkpoint'
import { errAsync, okAsync, type ResultAsync } from '@liam-hq/neverthrow'
import type { Schema } from '@liam-hq/schema'
import { schemaSchema } from '@liam-hq/schema'
import { applyPatch } from 'fast-json-patch'
import { errAsync, okAsync, type ResultAsync } from 'neverthrow'
import * as v from 'valibot'
import type {
CreateVersionParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { BaseCheckpointSaver } from '@langchain/langgraph-checkpoint'
import type { SupabaseClientType } from '@liam-hq/db'
import type { Json } from '@liam-hq/db/supabase/database.types'
import { errAsync, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import type { Schema } from '@liam-hq/schema'
import {
applyPatchOperations,
migrationOperationsSchema,
schemaSchema,
} from '@liam-hq/schema'
import { compare } from 'fast-json-patch'
import { errAsync, okAsync, ResultAsync } from 'neverthrow'
import * as v from 'valibot'
import { SupabaseCheckpointSaver } from '../checkpoint/SupabaseCheckpointSaver'
import { ensurePathStructure } from '../utils/pathPreparation'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { BaseCheckpointSaver } from '@langchain/langgraph-checkpoint'
import type { ResultAsync } from '@liam-hq/neverthrow'
import type { Schema } from '@liam-hq/schema'
import type { Operation } from 'fast-json-patch'
import type { ResultAsync } from 'neverthrow'

export type SchemaData = {
id: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { RunnableConfig } from '@langchain/core/runnables'
import { fromValibotSafeParse } from '@liam-hq/neverthrow'
import { ok, type Result } from 'neverthrow'
import { fromValibotSafeParse, ok, type Result } from '@liam-hq/neverthrow'
import * as v from 'valibot'
import type { Repositories } from '../repositories'
import {
Expand Down
2 changes: 1 addition & 1 deletion frontend/internal-packages/agent/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ResultAsync } from '@liam-hq/neverthrow'
import type { Schema } from '@liam-hq/schema'
import type { ResultAsync } from 'neverthrow'
import type * as v from 'valibot'
import type { Repositories } from './repositories'
import type { reasoningSchema } from './utils/validationSchema'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RunnableConfig } from '@langchain/core/runnables'
import type { Result } from 'neverthrow'
import { err, ok } from 'neverthrow'
import type { Result } from '@liam-hq/neverthrow'
import { err, ok } from '@liam-hq/neverthrow'
import type { WorkflowConfigurable } from '../types'

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { err, ok, type Result } from '@liam-hq/neverthrow'
import type { Operation } from 'fast-json-patch'
import { err, ok, type Result } from 'neverthrow'

/**
* Unescape JSON Pointer path according to RFC 6901
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
import process from 'node:process'
import type { Result } from '@liam-hq/neverthrow'
import { fromThrowable } from '@liam-hq/neverthrow'
import type { Result } from 'neverthrow'

/**
* Environment information for enhanced tracing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HumanMessage } from '@langchain/core/messages'
import type { RunnableConfig } from '@langchain/core/runnables'
import { RunCollectorCallbackHandler } from '@langchain/core/tracers/run_collector'
import { END } from '@langchain/langgraph'
import { errAsync, ok, okAsync, ResultAsync } from 'neverthrow'
import { errAsync, ok, okAsync, ResultAsync } from '@liam-hq/neverthrow'
import { DEFAULT_RECURSION_LIMIT } from '../constants'
import type {
AgentWorkflowParams,
Expand Down
3 changes: 1 addition & 2 deletions frontend/internal-packages/configs/eslint/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ export function createBaseConfig(options = {}) {
paths: [
{
name: "neverthrow",
importNames: ["fromThrowable", "fromAsyncThrowable"],
message: "Use @liam-hq/neverthrow instead for consistent error handling",
message: "Import from @liam-hq/neverthrow instead",
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const noThrowErrorPlugin = {
) {
context.report({
node,
message: 'Use neverthrow Result types (err, ok, ResultAsync) instead of throwing Error. Import from "neverthrow".',
message: 'Use neverthrow Result types (err, ok, ResultAsync) instead of throwing Error. Import from "@liam-hq/neverthrow".',
})
}
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/internal-packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
},
"main": "src/index.ts",
"dependencies": {
"@liam-hq/neverthrow": "workspace:*",
"@supabase/ssr": "0.7.0",
"@supabase/supabase-js": "2.75.0",
"neverthrow": "8.2.0",
"valibot": "1.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/internal-packages/db/src/utils/retry.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { err, ok } from 'neverthrow'
import { err, ok } from '@liam-hq/neverthrow'
import { describe, expect, it, vi } from 'vitest'
import { retry } from './retry'

Expand Down
2 changes: 1 addition & 1 deletion frontend/internal-packages/db/src/utils/retry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ResultAsync } from 'neverthrow'
import { ResultAsync } from '@liam-hq/neverthrow'

/**
* Retry configuration for Supabase operations
Expand Down
2 changes: 1 addition & 1 deletion frontend/internal-packages/db/src/utils/toResultAsync.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { errAsync, okAsync, ResultAsync } from 'neverthrow'
import { errAsync, okAsync, ResultAsync } from '@liam-hq/neverthrow'

/**
* Options for toResultAsync function
Expand Down
1 change: 0 additions & 1 deletion frontend/internal-packages/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"@octokit/auth-app": "7.2.2",
"@octokit/openapi-types": "25.1.0",
"@octokit/rest": "21.1.1",
"neverthrow": "8.2.0",
"valibot": "1.1.0"
},
"devDependencies": {
Expand Down
Loading
Loading