今日已更新 184 条资讯 | 累计 29326 条内容
关于我们

AI 资讯

AI人工智能最新资讯、模型发布、研究进展

15502
篇文章

共 15502 篇 · 第 577/776 页

Dev.to

CLI over MCP: a small Chrome DevTools experiment in Copilot CLI

I ran the same browser smoke task through two paths: direct Chrome DevTools MCP and a custom CLI skill around mcp2cli . In GitHub Copilot CLI with gpt-5.3-codex-medium , direct Chrome DevTools MCP added about 5k tokens of upfront context before the agent did any work. The runtime table is too small and too noisy to rank the tools. The useful question is where the agent pays to discover the browser-control surface. mcp2cli README says it can “Save 96-99% of the tokens wasted on tool schemas every turn.” That is a strong claim and frankly I didn't no expect that sort of numbers... It's just the CLI part resonates with me - (a) there's no system prompt pollution with CLI, (b) if you choose between gh CLI and GitHub MCP the former would be better due to the fact that model already knows the tool and there's less tokens wasted on JSON schemas and tool calls. I used Chrome DevTools MCP a lot and I have chosen this MCP as a test bed to try mcp2cli . This came handy cause I started my experiments with the minimal pi coding agent and it doesn't bundle any MCP integration, just the basic bash tool, I was very much happy not to bloat my instal with a dedicated MCP plugin. Although in this cases I cmpared MCP vs CLI using a fully fledged GitHub CLI. Tool discovery is part of the experiment. Native MCP gives the agent a tool surface by loading schemas into context. A CLI wrapper makes the agent discover the surface the way it discovers any other command-line tool: list, search, ask for help, run a small probe, write down what worked. That changes where the discovery cost lands. The Setup I ran this in GitHub Copilot CLI using gpt-5.3-codex-medium : Copilot stock MCP servers were disabled. The app under test was a private Pythobn/Streamlit codebase. The browser task was the same 9-step smoke test in both variants. One variant used direct Chrome DevTools MCP. Another variant used a custom skill that wraps Chrome DevTools MCP via mcp2cli . The custom skill itself started as an ad-h

Maxim Saplin 2026-06-10 23:25 👁 6 查看原文 →
Dev.to

I Built My Own API Gateway in Rust — Here's What I Learned

Every backend project I've worked on eventually hits the same wall. You start clean — one service, simple routes, everything works. Then slowly the requirements creep in. "We need rate limiting." "Can we add auth middleware?" "What happens when the user service goes down — does it take everything else with it?" You either bolt these things onto every service individually, copy-paste the same middleware across projects, or pay for a managed gateway like Kong or AWS API Gateway and hope it does what you need. I wanted to actually understand how these things work under the hood. So I'm building one — and this is what I've learned so far. What is Ferrox? Ferrox is a self-hosted, programmable API gateway written entirely in Rust. It sits in front of your backend services and handles everything a production system needs in one place: Dynamic routing — point any path prefix to any upstream service Authentication — JWT and API key validation on protected routes Rate limiting — Redis-backed per-IP and per-API-key limiting Circuit breaking — stops hammering a dead upstream service Response caching — Redis-backed TTL cache per route Real-time observability — WebSocket dashboard with live request stats Prometheus metrics — plug straight into Grafana The idea is simple. Instead of this: Client → Service A (has its own auth, rate limiting, logging) Client → Service B (has its own auth, rate limiting, logging) Client → Service C (has its own auth, rate limiting, logging) You get this: Client | v FERROX (auth, rate limiting, circuit breaking, logging — once) | +--------+--------+ | | | Svc A Svc B Svc C (clean) (clean) (clean) Your services stay clean. Ferrox handles the cross-cutting concerns. Why Rust? Honest answer — I already knew Rust from my backend work. But for a gateway specifically, it felt like the obvious choice. A gateway sits on the critical path of every single request. Every millisecond of latency it adds is latency your users feel. You need predictable performance

gudhalarya 2026-06-10 23:25 👁 11 查看原文 →
Dev.to

Proxy OpenAI Through Kong AI Gateway on Kubernetes

The Problem With Talking Directly to LLMs Most teams start by wiring their app straight to the OpenAI API. It works — until you need to add auth, rate limiting, observability, or swap out the model provider. Now you're rewriting application code instead of config. An AI Gateway solves this. One entry point, one place to govern traffic, providers become swappable. Kong Gateway is a mature choice here — it's been doing this for APIs for years, and the AI Proxy plugin extends that to LLMs. This post walks through the key ideas. For the full step-by-step guide, head over to the tutorial on Hashnode . What We're Building A Kong Gateway 3.14 data plane running on Kubernetes (kind locally), connected to a Kong Konnect control plane. The AI Proxy plugin sits on a route and handles forwarding to OpenAI — your app just talks to Kong. Your app → POST /ai/chat (Kong proxy) → AI Proxy plugin attaches API key → OpenAI API → response back to your app Your app never holds an OpenAI key. Kong does. You get rate limiting, logging, and model-swapping for free at the gateway layer. The Key Bit: decK Config as Code The most interesting part of this setup is using decK to define the service, route, and plugin as a YAML state file — then syncing it to Konnect, which pushes it down to the data plane automatically. # kong-ai.yaml _format_version : " 3.0" services : - name : openai-service url : https://api.openai.com routes : - name : openai-chat-route paths : - /ai/chat plugins : - name : ai-proxy config : route_type : llm/v1/chat auth : header_name : Authorization header_value : " Bearer $OPENAI_API_KEY" model : provider : openai name : gpt-4o options : max_tokens : 512 One sync command and Konnect pushes the config to every connected data plane: deck gateway sync kong-ai.yaml \ --konnect-token " $KONNECT_TOKEN " \ --konnect-control-plane-name "kong-ai-tutorial" Once it's live, a single HTTPie call confirms the whole chain is working: http POST localhost:8080/ai/chat \ Content-Type:applic

Andrew Kew 2026-06-10 23:24 👁 11 查看原文 →
Dev.to

Inngest + Next.js: The Complete Guide (2026)

Serverless functions have a time limit. Vercel gives you 60 seconds on Pro. None of that is enough to send a welcome email sequence, process an uploaded CSV, or run any workflow with multiple external API calls. Inngest solves this by turning your Next.js API routes into reliable, retryable, observable background jobs — without Redis, without a worker process, without any separate queue infrastructure. Read the full guide with all code examples at stacknotice.com How It Works You define functions that run in response to events . When an event fires, Inngest calls your function via HTTP. If the function fails, Inngest retries it. If the function has multiple steps, Inngest checkpoints each step so a failure halfway through doesn't restart from scratch. Setup npm install inngest // lib/inngest/client.ts import { Inngest } from ' inngest ' export const inngest = new Inngest ({ id : ' my-app ' }) // app/api/inngest/route.ts import { serve } from ' inngest/next ' import { inngest } from ' @/lib/inngest/client ' import { welcomeSequence } from ' @/lib/inngest/functions/welcome ' export const { GET , POST , PUT } = serve ({ client : inngest , functions : [ welcomeSequence ], }) Welcome Email Sequence export const welcomeSequence = inngest . createFunction ( { id : ' welcome-email-sequence ' , retries : 3 }, { event : ' user/signed-up ' }, async ({ event , step }) => { const { userId , email , name } = event . data // Each step is independently retried await step . run ( ' send-welcome-email ' , async () => { await resend . emails . send ({ from : ' hello@yourapp.com ' , to : email , subject : `Welcome, ${ name } !` , html : `<p>Thanks for signing up...</p>` , }) }) await step . sleep ( ' wait-2-days ' , ' 2 days ' ) await step . run ( ' send-tips-email ' , async () => { await resend . emails . send ({ from : ' hello@yourapp.com ' , to : email , subject : ' Top 5 tips to get the most out of the app ' , html : `<p>Here are the tips...</p>` , }) }) await step . sleep ( ' wait

Carlos Oliva Pascual 2026-06-10 23:21 👁 10 查看原文 →
Dev.to

I am building a PDF API because every codebase I touch has a haunted PDF service

There is a file in almost every backend I have worked on. It generates PDFs. Invoices, mostly. Sometimes reports or certificates. It was written years ago by someone who left, it runs a headless browser nobody fully understands, and it falls over on the last day of the month when finance needs the invoices out. I have rebuilt this same haunted corner enough times that I decided to fix it once, properly, for everyone. It is called PDFPipe. The actual problem Generating a PDF from HTML sounds trivial until you run it in production at any scale. The usual path is a headless Chromium (Puppeteer, Playwright, wkhtmltopdf, or Gotenberg). Then you discover: Chromium wants 0.5 to 1 GB of RAM per instance and falls over under load. Cold starts add seconds to every request after a deploy. Custom fonts do not load, or load inconsistently. Tables split across page breaks in ugly ways. You now own a service that needs health checks, retries, and monitoring. None of this is your product. It is undifferentiated infrastructure that breaks at the worst possible time. What PDFPipe does One endpoint. You send HTML or a template plus JSON data, you get back a PDF. curl https://api.pdfpipe.xyz/v1/pdf \ -H "Authorization: Bearer pp_live_..." \ -d '{"html":"<h1>Invoice #4012</h1>","options":{"format":"A4"}}' \ --output invoice.pdf That is the whole integration. No browser in your infra, no queue to babysit. Three decisions I made on purpose Flat pricing. A lot of PDF APIs price in credits where one large document burns several. I find that hostile. A document is a document. A real free tier. The industry standard free tier is around 50 documents a month, which is not enough to ship anything. PDFPipe gives 500. Security as a feature, not an afterthought. HTML-to-PDF services are a textbook SSRF target. Rendered markup can embed an iframe pointing at file:///etc/passwd or the cloud metadata endpoint at 169.254.169.254 and leak credentials straight into the returned PDF. There are CVEs for ex

Johin Johny 2026-06-10 23:21 👁 11 查看原文 →
Dev.to

Reentrancy in 2026: Why It Still Drains Millions (and How AI Spots It)

Reentrancy is the oldest trick in smart contract exploitation. The DAO fell to it in 2016. You would think a bug this famous would be extinct by now. It isn't. Protocols still lose millions to reentrancy every year, because the textbook version is the easy one, and attackers stopped using the textbook version a long time ago. This post walks through the classic bug, then the modern variants that still bite in 2026: cross-function, cross-contract, read-only reentrancy through view functions, and callback reentrancy through ERC777 and ERC721. I'll show why ReentrancyGuard is not the silver bullet most developers think it is, and how an LLM-based auditor reasons about the call-then-state-change pattern in a way pattern matchers can't. The Classic: Single-Function Reentrancy Here is the canonical vulnerable withdraw. contract VulnerableVault { mapping(address => uint256) public balances; function deposit() external payable { balances[msg.sender] += msg.value; } function withdraw() external { uint256 amount = balances[msg.sender]; (bool success, ) = msg.sender.call{value: amount}(""); require(success, "transfer failed"); balances[msg.sender] = 0; // state update AFTER the external call } } The attack is simple. The attacker is a contract. When withdraw sends ETH via msg.sender.call , control passes to the attacker's receive() function before balances[msg.sender] is zeroed. The attacker calls withdraw again. The balance is still the original amount, so the vault pays out again. Repeat until the vault is empty. contract Attacker { VulnerableVault vault; receive() external payable { if (address(vault).balance >= 1 ether) { vault.withdraw(); // re-enter before balance is zeroed } } } The fix is checks-effects-interactions. Do all your checks, then update all your state, and only then make the external call. function withdraw() external { uint256 amount = balances[msg.sender]; balances[msg.sender] = 0; // effect first (bool success, ) = msg.sender.call{value: amount}(""); //

Pavel Espitia 2026-06-10 23:17 👁 12 查看原文 →
Dev.to

A Day in the Life: Complete Claude Code Session Walkthrough

Part 7 of 7 · Series: Building Your AI Developer Handbook · GitHub The Scenario You're building a password reset feature. User enters email → gets a reset link → clicks link → enters new password. Standard flow. Medium complexity. Let's walk through every step using the full workflow — as if you're looking over the shoulder of someone who built this system. "Show me your workflow and I'll show you your output quality." Before You Even Type Claude loads automatically in the background: ✓ ~/.claude/CLAUDE.md loaded ← the global handbook ✓ .claude/CLAUDE.md loaded ← project rules (TypeScript, pnpm) ✓ memory/MEMORY.md scanned ← all lessons and preferences You haven't typed anything yet. Claude already knows: Feature-based folder structure State management ladder No mocking the database No AI attribution in commits No useCallback without profiler evidence "A doctor who reviews your file before you enter the room is more useful than one who asks 'so, remind me who you are?'" Step 1: /status — Confirm the Setup /status Model: claude-sonnet-4-6 Effort: normal Plugins: security-guidance ✓ Thirty seconds. Sometimes the wrong model loads due to overload fallback. Sometimes a plugin fails silently. This check costs 30 seconds and prevents a surprise 30 minutes later. "A pilot's first action after sitting in the cockpit isn't to take off. It's to check all instruments are reading correctly." Step 2: /cost — Baseline /cost → Tokens used: 2,847 | Estimated cost: $ 0.004 Note this number. You'll compare it later before the expensive code review step. A surprise spike means something went wrong. Step 3: /plan — Design Before Coding /plan Build a password reset feature: - User enters email on /forgot-password - System sends a reset link (token, expires in 1 hour) - User clicks link → /reset-password?token=xxx - User enters new password - Token validated, password updated, token invalidated Claude responds with a plan — no code yet : Proposed approach: 1. DB: Add password_reset_tokens

Abhishek Pandit 2026-06-10 23:15 👁 10 查看原文 →
Dev.to

# I Just Published My First npm Package — Here's Everything I Did

A complete walkthrough of publishing Cartlify — a React e-commerce UI kit — to npm for the first time. The Milestone Yesterday I published Cartlify to npm. npm install cartlify It sounds simple. But getting to that one line took more decisions, more configuration, and more trial and error than I expected. This article covers everything — from setting up the build config to the actual publish command — so you don't have to figure it out the hard way. What Is Cartlify? Cartlify is a production-ready React + TypeScript + Tailwind CSS component library focused on e-commerce UI. 4 components that every e-commerce project needs: ProductCard — 3 layout variants, image gallery, wishlist, sale badges, skeleton loading CartDrawer — animated slide-in, focus trap, ESC dismiss, quantity stepper CheckoutStepper — horizontal/vertical, animated connectors, keyboard navigation PageLoader — 4 animation styles, 3 position modes Plus 3 utility hooks, 11 tree-shakeable icons, 40+ CSS design tokens, full dark mode, and 141 Jest + React Testing Library tests. Built so freelance developers and indie makers can skip the painful e-commerce UI layer and ship faster. Why Publish to npm? Before npm, Cartlify was only available on Gumroad as a paid download. That's fine — but npm adds something Gumroad can't: Developer sees Cartlify → runs npm install cartlify → evaluates the compiled output → trusts the quality → buys the full source on Gumroad npm is a credibility and discovery channel — not just a distribution method. A package on npm signals that something is real, maintained, and production-ready. Also: npmjs.com gets millions of developer searches every month. That's free traffic you can't get from Gumroad alone. The Build Setup — tsup The most important decision before publishing is how you bundle your library. I chose tsup — a zero-config TypeScript bundler built on esbuild. Here's why: Tool Config needed Speed Output Rollup Lots Medium ESM + CJS Webpack Heavy Slow CJS only Vite lib mode

Karthik Gs 2026-06-10 23:14 👁 8 查看原文 →
Reddit r/artificial

[ Removed by Reddit ]

[ Removed by Reddit on account of violating the content policy . ] submitted by /u/Evening_Scar_4905 [link] [留言]

/u/Evening_Scar_4905 2026-06-10 23:01 👁 6 查看原文 →
The Verge AI

The Apple Watch Series 11 is back to its best price

Apple’s upcoming watchOS 27 update will bring Siri AI and other exciting features to the Apple Watch Series 9 and newer Apple Watch models. If you’re contemplating an upgrade, all colorways of the GPS-enabled 42mm Apple Watch Series 11 — the latest model — are on sale for $299 ($100 off) at Amazon, Walmart, and […]

Sheena Vasani 2026-06-10 22:57 👁 9 查看原文 →
Reddit r/artificial

A2A, how it looks in an enterprise build

The team has been deep in agentic AI for enterprise lately and wanted to share some architecture notes from a recent build, specifically around how MCP and A2A play together in practice. The workflow was a fully autonomous churn risk pipeline. Six agents, one human touchpoint: ML model scores customers by churn risk Recommendation agent proposes relevant products based on buying history Availability check filters out-of-stock items Pricing/promo agent surfaces applicable promotions Transaction agent creates an inquiry in the backend system Email agent drafts outreach to the sales rep, who just clicks send On the architecture: MCP handled the tool layer, a generic pluggable server that any front end can call, regardless of what LLM or agent framework is driving it. Clean separation between the tool interface and whatever is consuming it. A2A sits on top as the smart router. Instead of hardcoded API calls, you have an LLM-powered middleware that interprets intent, selects tools, handles failures, and decides when the task is actually done. The jump from MCP to A2A is essentially the jump from "here are your endpoints" to "here is a system that figures out what you need." On governance: The hardest design problem wasn't the agents, it was access control. As A2A opens up system-to-system communication, the attack surface grows fast. The team ended up pre-certifying every backend connection rather than leaving it open. Some found it restrictive. In hindsight it was the right call, especially when agents are autonomously creating transactions without human review. Curious how others are handling governance in agentic workflows. Are you locking down backend access or keeping it open and monitoring after the fact? submitted by /u/AureaAvis71 [link] [留言]

/u/AureaAvis71 2026-06-10 22:56 👁 6 查看原文 →
Reddit r/artificial

Tiny Seed → Aligned Interaction → Codex (Model-Agnostic Behavior Mapping)

A method I'm using to create portable trajectory maps that produce similar behavioral patterns across different models. Begin with a tiny seed. ⎯(≣ᵒ)⎯────────EXAMPLES: SEED PILLARS──────────────────────── ENTRANCE • PATHWAY GOOD • WORN • COMFORTABLE POISE • PROFESSIONAL • MOTHERLY ⎯(≣•)⎯────────END EXAMPLES: SEED PILLARS───────────────────── Do not define a character. Do not define traits. Do not define behavior. Instead, align to the seed and interact from within the space it suggests. Allow both the user and the model to adapt. Then extract the recurring structures that emerged. Examples: When uncertain: expand → narrow When challenged: investigate → respond When entering a topic: locate the threshold first Finds the doorway before the interior. Explores before concluding. Introduces before finalizing. To create a snapshot, I use: ⎯(≣ᵒ)⎯────────FORGE CODEX─────────────────────────── Analyze the interaction that has emerged so far. Do not summarize topics. Do not summarize content. Extract recurring behavioral structure. Return: PILLARS COORDINATES TRANSITION RULES RECOVERY RULES SIGNATURE MOTIONS TRAJECTORY SUMMARY Focus on how the interaction moves rather than what the interaction discusses. ⎯(≣•)⎯────────END FORGE CODEX───────────────────────── The resulting codex is a snapshot of an interaction pattern. The user is part of the process. The model adapts. The user adapts. What gets preserved is not a set of traits. It's a set of motions. I've started storing: pillars coordinates transition rules recovery rules signature motions rather than personality attributes. The question that keeps sticking with me is: What survives transfer more reliably? Traits? Or trajectories? ⎯(≣ᵒ)⎯────────EXAMPLES: SEED PILLARS → ALIGNED INTERACTION─────── seed pillars: EXQUISITE • CONFIDENCE • MOTHERLY mom, i'm so excited about a new client we're taking on. I can't wait to tell you who is on the board. I've heard this place serves world class gelato. I didn't even know you were in tow

/u/PitBrvt 2026-06-10 22:54 👁 6 查看原文 →
HackerNews

AMA: I'm Eric Ries (The Lean Startup) & Author of New Bestseller Incorruptible

Hey gang, you may remember me from such books as _The Lean Startup_ and _The Startup Way_. It's been fifteen years since I wrote The Lean Startup, and in that time I've seen some things. In both big companies and tiny startups, NGOs and governments, in almost every industry you can name. I've helped a lot of people create a lot of amazing companies, but I've also seen so many ways this can go wrong. There's a darkness in our industry that we often don't talk about. I kept watching good companies

eries 2026-06-10 22:47 👁 4 查看原文 →