Skip to content
Merged
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
2 changes: 0 additions & 2 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: beta

on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"

jobs:
sync:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/branding-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
push:
branches:
- main
- dev
pull_request:
workflow_dispatch:

permissions:
contents: read
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/close-issues.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: close-issues

on:
schedule:
- cron: "0 2 * * *" # Daily at 2:00 AM
workflow_dispatch:

jobs:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/close-prs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: close-prs

on:
schedule:
- cron: "0 22 * * *" # Daily at 10:00 PM UTC
workflow_dispatch:
inputs:
dry-run:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/compliance-close.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: compliance-close

on:
schedule:
# Run every 30 minutes to check for expired compliance windows
- cron: "*/30 * * * *"
workflow_dispatch:

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: containers
on:
push:
branches:
- dev
- main
paths:
- packages/containers/**
- .github/workflows/containers.yml
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: deploy
on:
push:
branches:
- dev
- production
- main
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/desktop-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ name: desktop-build
# Linux packages are unsigned here.

on:
# Only the dev->main merge (push to main); ad-hoc runs via workflow_dispatch.
push:
branches:
- main
# W-01 §2.2.6 trigger extension: exercise the Windows packaging path on
# the dev mainline too (windows targets only, no release publishing — the
# release job stays main-only), so NSIS + Trusted Signing + the packaged
# smoke regress on every dev push instead of only at release time.
- dev
workflow_dispatch:
inputs:
channel:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-locale-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: docs-locale-sync
on:
push:
branches:
- dev
- main
paths:
- packages/web/src/content/docs/*.mdx

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docs-update.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: docs-update

on:
schedule:
- cron: "0 */12 * * *"
workflow_dispatch:

env:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/duplicate-issues.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: duplicate-issues

on:
issues:
types: [opened, edited]
workflow_dispatch:

jobs:
check-duplicates:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: generate
on:
push:
branches:
- dev
- main
workflow_dispatch:

jobs:
generate:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/nix-eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: nix-eval

on:
push:
branches: [dev]
pull_request:
branches: [dev]
branches: [main]
workflow_dispatch:

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nix-hashes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:
on:
workflow_dispatch:
push:
branches: [dev, beta]
branches: [main]
paths:
- "bun.lock"
- "package.json"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-management.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: pr-management

on:
pull_request_target:
types: [opened]
workflow_dispatch:

jobs:
add-contributor-label:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-routing.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: pr-routing

on:
pull_request_target:
types: [opened, reopened, edited, synchronize, ready_for_review]
workflow_dispatch:

permissions:
contents: read
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-standards.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: pr-standards

on:
pull_request_target:
types: [opened, edited, synchronize]
workflow_dispatch:

jobs:
check-standards:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ name: publish
run-name: "${{ format('release {0}', inputs.bump) }}"

on:
# Only the dev->main merge (push to main) builds; releases themselves are
# workflow_dispatch with an explicit version.
push:
branches:
- ci
- dev
- beta
- fix/npm-native-binary-install
- snapshot-*
- main
workflow_dispatch:
inputs:
bump:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-github-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release-github-action
on:
push:
branches:
- dev
- main
paths:
- "github/**"

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/stats.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: stats

on:
schedule:
- cron: "0 12 * * *" # Run daily at 12:00 UTC
workflow_dispatch: # Allow manual trigger
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ name: storybook

on:
push:
branches: [dev]
paths:
- ".github/workflows/storybook.yml"
- "package.json"
- "bun.lock"
- "packages/storybook/**"
- "packages/ui/**"
pull_request:
branches: [dev]
branches: [main]
paths:
- ".github/workflows/storybook.yml"
- "package.json"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: test
on:
push:
branches:
- dev
pull_request:
- main
workflow_dispatch:

concurrency:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ name: typecheck

on:
push:
branches: [dev]
# Gate every PR regardless of target branch: the typecheck baseline is easily polluted by stale
# worktrees/generated files, so keep it required and branch-agnostic.
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Expand Down
10 changes: 6 additions & 4 deletions packages/deepagent-code/src/mcp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { InstanceState } from "@/effect/instance-state"
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
import { CrossSpawnSpawner } from "@deepagent-code/core/cross-spawn-spawner"
import { applyEdits, modify, parse } from "jsonc-parser"
import { Filesystem } from "@/util/filesystem"

const log = Log.create({ service: "mcp" })
const DEFAULT_TIMEOUT = 30_000
Expand All @@ -48,16 +49,17 @@ const TolerantListToolsResultSchema = ListToolsResultSchema.extend({
// Replace one server entry in a jsonc config file in place, keeping comments and sibling keys
// intact. Returns false when the file is absent or no longer declares that server (raced removal
// or a shadowed origin) so the caller can surface that the plaintext may still live there.
// Filesystem (node:fs) rather than Bun.file: this module is also bundled into the desktop's
// Node sidecar, whose build fails on any Bun-only runtime API.
export async function rewriteMcpEntry(origin: string, server: string, entry: ConfigMCPV1.Info): Promise<boolean> {
const file = Bun.file(origin)
if (!(await file.exists())) return false
const text = await file.text()
if (!(await Filesystem.exists(origin))) return false
const text = await Filesystem.readText(origin)
const parsed = parse(text) as { mcp?: Record<string, unknown> } | undefined
if (!parsed || typeof parsed !== "object" || !parsed.mcp || !(server in parsed.mcp)) return false
const edits = modify(text, ["mcp", server], structuredClone(entry), {
formattingOptions: { tabSize: 2, insertSpaces: true },
})
await Bun.file(origin).write(applyEdits(text, edits))
await Filesystem.write(origin, applyEdits(text, edits))
return true
}

Expand Down
Loading