AI 资讯
Treat Voice-Companion Memory as a Consent Ledger, Not Prompt History
A personalized voice companion creates an uncomfortable trade-off: users do not want to repeat themselves, but they also do not want a misheard sentence to become a permanent “fact.” That tension is often hidden by calling conversation history memory . The implementation then retrieves old text, inserts it into a prompt, and trusts the LLM to interpret it correctly. A safer design gives memory to the application, not the model: The model may propose a typed fact. The companion must ask whether it should remember that fact. The user may confirm, reject, correct, or later revoke it. Only active, confirmed records can enter an LLM request. This tutorial builds that boundary in TypeScript and shows how it fits a Tencent RTC Conversational AI voice companion. We will use a social companion that can remember a preferred name, music genre, and conversation style—but not arbitrary instructions. Start with the trust boundary Keep the live-media pipeline and the memory lifecycle separate: Microphone │ ▼ Real-time voice session / speech recognition │ recognized turn ▼ Application turn coordinator ─────► LLM provider │ │ │ proposed typed memory │ response text ▼ ▼ Consent ledger Speech synthesis │ └──── confirmed facts only ────────► future LLM prompts Tencent RTC's Conversational AI documentation describes real-time voice interaction with multiple LLM providers. Its LLM configuration guidance also covers OpenAI-compatible models, agent platforms such as Dify and Coze, and request identifiers for routing and observability: Tencent Conversational AI overview Large Language Model configuration Social Entertainment solution The RTC layer can carry the live conversation, but your application should remain authoritative over what becomes durable memory. What the LLM is allowed to do For this example, the model can suggest one of three bounded slots: Slot Accepted values Suggested lifetime preferred_name A short name Until revoked music_genre An application-owned enum 30 days chat_st
开源项目
🔥 abhigyanpatwari / GitNexus - GitNexus: The Zero-Server Code Intelligence Engine - GitNexu
GitHub热门项目 | GitNexus: The Zero-Server Code Intelligence Engine - GitNexus is a client-side knowledge graph creator that runs entirely in your browser. Drop in a git repository (Github, Gitlab, Azure, Local) or ZIP file, and get an interactive knowledge graph with a built in Graph RAG Agent. Perfect for code exploration | Stars: 46,029 | 189 stars today | 语言: TypeScript
AI 资讯
Connect a Local Developer Toolbox to Any MCP Assistant
If an AI assistant can write code but cannot reliably hash a value, inspect a JWT, validate JSON, or calculate a CIDR range, you have a small but recurring reliability problem. Asking the model to do those jobs from memory adds an unnecessary interpretation step. DevUtils MCP Server packages 36 everyday developer utilities behind the Model Context Protocol . The server runs locally over standard input and output, so an MCP-compatible client can call explicit tools instead of guessing an operation. This tutorial connects the released 1.1.0 package, verifies the protocol handshake, and shows how to choose a useful tool without treating the server as a replacement for application libraries. TL;DR Install Node.js 18 or newer, add the server command to your MCP client's configuration, restart the client, and ask it to use a tool such as json_validate , jwt_validate , or cidr_calculate . The smallest configuration is a command plus the package name: { "mcpServers" : { "devutils" : { "command" : "npx" , "args" : [ "devutils-mcp-server" ] } } } The released package declares Node.js >=18 . The repository's current default branch has moved ahead to 1.1.1 , so the commands and behavior in this article target the immutable v1.1.0 release and the npm latest package that was verified during research. Prerequisites You need: Node.js 18 or newer and npm. An MCP-compatible client that supports a local stdio server. Permission to run npx and download the public npm package on first use. No API key, account, database, or external service is needed for the local server. The MIT-licensed repository lists Claude Desktop, Cursor, VS Code, Windsurf, Docker, and other MCP-compatible clients as possible consumers. Their configuration file locations differ, but the server entry is the same. Install the released server The release README documents an npx path that does not require a global installation: npx devutils-mcp-server For an automated setup where accepting the package prompt must be e
AI 资讯
Building an Enterprise Football Data Pipeline: Decoding Flashscore's Protocol for xG & Referee Analytics
Most football data scrapers on the market only extract high-level final scores (e.g. 2-1 ). But quantitative sports analysts, data scientists, and predictive betting modelers need granular data: Expected Goals (xG) , Official Referee Assignments , Goal Scorers paired with Assist Providers , and Half-Time vs Full-Time (1H/2H) statistical breakdowns . When I set out to build a professional-grade Flashscore scraper on Apify, I ran into two major engineering challenges: The Memory Problem : Keeping Puppeteer running to scrape hundreds of historical matches consumes over 1.5GB of RAM per run. The Protocol Problem : Flashscore serves its deep statistical feeds using a proprietary pipe-delimited data format ( ~ , ¬ , ÷ ) over CDN endpoints, rather than standard REST APIs. In this tutorial, I'll explain how I engineered the Flashscore Elite Statistics Extractor , how the hybrid Browser + HTTP/2 streaming pipeline drops RAM footprint from 1.5GB to 70MB , how to parse Flashscore's custom feed protocol, and how to pipe the resulting datasets directly into Python and Pandas. 🏛️ The Hybrid Pipeline Architecture To achieve zero proxy reliance for standard runs and ultra-low compute costs, the Actor splits execution into a 2-Phase Hybrid Pipeline : [ League & Season Selection ] │ ▼ ┌───────────────────────────────────────────┐ │ Phase 1: Browser Handshake (Puppeteer) │ │ - Captures x-fsign security tokens │ │ - Extracts countryId & tourId │ └─────────────────────┬─────────────────────┘ │ [ Immediate Browser Shutdown ] (RAM drops from 1.2GB -> 70MB) │ ▼ ┌───────────────────────────────────────────┐ │ Phase 2: Parallel HTTP/2 Feed Workers │ │ - got-scraping with JA3 TLS matching │ │ - Decodes df_st_1_ (Stats) & df_sui_1_ │ └─────────────────────┬─────────────────────┘ │ ▼ ┌───────────────────────────────────────────┐ │ Self-Healing Recovery Pass │ │ - Auto-retries skipped/failed matches │ └─────────────────────┬─────────────────────┘ │ ▼ ┌───────────────────────────────────────────┐
AI 资讯
NestJS Request Lifecycle Explained (with Cheat Sheet)
A complete guide to the NestJS request lifecycle: the exact order middleware, guards, interceptors, pipes, and filters run, and why it matters.
AI 资讯
How to Build an AI Employee With a Knowledge Graph (Not Just Another Agent)
An AI agent can take an action. An AI employee needs to know what happens next. Most AI agents look something like this: Think → Act → Observe → Repeat That's fine for short-lived tasks. But an AI employee needs to work across hours, days, and weeks. It needs to remember: What happened Who owns the work What is waiting What changed What should happen next When it should wake up When a human needs to approve something That's where graph engineering becomes interesting. This is the architecture behind Roster : software that can own work the way an employee does, not just fire off a single tool call. Events wake someone up. A graph holds state, ownership, and history. The agent reasons, acts, writes the result back, then sleeps until the next event. For Roster, the loop looks like this: Event ↓ Graph ↓ Agent ↓ Action ↓ Graph Update ↓ Sleep ↓ Wake Again Let's build a tiny version. Table of Contents 1. Model the Work 2. Build the Graph 3. Add Events 4. Build the Agent Loop 5. Add Scheduling 6. Build a Tiny AI Employee 7. Put It Together 8. The Bigger Idea 1. Model the Work Imagine an AI employee called Maya. Her job is simple: Follow up with sales leads. Her world contains: Maya ↓ owns Lead ↓ belongs_to Company ↓ contacted Email ↓ replied_to Customer We don't need a massive graph database. We just need nodes and relationships. 2. Build the Graph Here's a minimal TypeScript graph: type Node = { id : string ; type : string ; data : Record < string , unknown > ; }; type Edge = { from : string ; to : string ; type : string ; }; class Graph { nodes = new Map < string , Node > (); edges : Edge [] = []; addNode ( node : Node ) { this . nodes . set ( node . id , node ); } connect ( from : string , type : string , to : string ) { this . edges . push ({ from , type , to }); } neighbors ( id : string ) { return this . edges . filter (( edge ) => edge . from === id ) . map (( edge ) => ({ relationship : edge . type , node : this . nodes . get ( edge . to ), })); } } Now create Maya
开源项目
🔥 tutti-os / tutti - Where people and agents build in tune.
GitHub热门项目 | Where people and agents build in tune. | Stars: 3,495 | 48 stars today | 语言: TypeScript
开源项目
🔥 NeoLabHQ / context-engineering-kit - Hand-crafted Claude Code Skills focused on improving agent r
GitHub热门项目 | Hand-crafted Claude Code Skills focused on improving agent results quality. Compatible with OpenCode, Cursor, Antigravity, Gemini CLI, and others. Includes CodeRabbit open-source alternative. | Stars: 1,415 | 16 stars today | 语言: TypeScript
开源项目
🔥 Tencent / BrowserSkill - Let AI agents use your real, logged-in browser without inter
GitHub热门项目 | Let AI agents use your real, logged-in browser without interrupting your work. CLI + extension for browser automation across any shell-capable AI agent. | Stars: 1,395 | 29 stars today | 语言: TypeScript
AI 资讯
validateHttp() Has No Async Machinery: A Trace From Signal Forms Down to fetch() 🔍🚀
Let's be honest: async validation is the part of any forms library where you brace yourself. Debouncing, cancelling the request the user just invalidated by typing another character, keeping a "checking..." spinner honest, not letting a slow response overwrite a fast one. Every library that has ever done this has grown a pile of bespoke machinery for it. So when Signal Forms shipped validateHttp() and it just worked, I wanted to see the pile. I opened the source expecting a few hundred lines of async bookkeeping, and instead found a function whose entire body is a single call to something else. That turned into a trace all the way down, from a form field to the line where bytes actually leave the browser. Six layers, and only two of them add anything you could call new async machinery. ✅ Availability: validateHttp() is @publicApi 22.0 , stable. Every source reference in this article is pinned to the v22.1.1 tag , so the line numbers stay valid even as main moves. 🧩 The View From Outside The usage is unremarkable, which is the point. You declare that a field validates against an endpoint, and you're done: const schema = form ( this . model , ( path ) => { validateHttp ( path . username , { request : ({ value }) => `/api/username-available?u= ${ value ()} ` , debounce : 300 , onError : () => ({ kind : ' server-unreachable ' }), onSuccess : ( res : { available : boolean }) => res . available ? undefined : { kind : ' username-taken ' }, }); }); Sync validators run first, the request waits until they pass, field().pending() is true while it's in flight, and typing again cancels the previous call. If you've read Part 3 of my Signal Forms series , that's the behaviour contract you already know. The question here is who implements it. 🔍 Layer 1: validateHttp() Is a Delegation Here is the whole function, from validate_http.ts : export function validateHttp ( path , opts ) { validateAsync ( path , { params : opts . request , debounce : opts . debounce , factory : ( request )
AI 资讯
Past the README Demo: Conversations, Healthcare Data, Agents, and CI Checks
"Extract a name and email from this sentence" is the easy 10% of structured output. The other 90% is everything that doesn't fit in one prompt, one turn, or one model call. Here are five things shapecraft handles once you're past the basics. 1. Collecting data across a whole conversation A single message rarely has everything you need. Someone books an appointment over three or four back-and-forth messages, not one. turnaround mode lets the conversation run naturally and validates the whole transcript once, at the end, against one schema: import { generate , openai } from " @aviasole/shapecraft " ; const result = await generate ( model , BookingSchema , conversationHistory , { turnaround : true , }); No manual "do I have everything yet?" tracking, no partial-state bugs, just one validated object once the conversation is actually complete. 2. Extracting from clinical notes into real FHIR shapes Healthcare data has a standard (FHIR R4) and it's not optional if you're integrating with anything real. Built-in presets mean you're not hand-writing a Patient or Observation schema from scratch: import { generate , openai } from " @aviasole/shapecraft/fhir " ; import { PatientSchema } from " @aviasole/shapecraft/fhir " ; const patient = await generate ( openai ({ model : " gpt-4o-mini " }), PatientSchema , clinicalNote ); Same retry/validation guarantees as any other schema, just pre-built to match a spec you'd otherwise have to implement yourself. 3. An agent that checks real data before answering "Is this order still on hold?" isn't answerable from the prompt alone, it needs an actual lookup. generateWithTools() lets the model call your functions, see the results, and then produce a validated final answer: import { generateWithTools } from " @aviasole/shapecraft " ; const result = await generateWithTools ( model , [ lookupOrder ], AnswerSchema , userQuestion ); The tool call's arguments are validated before your function ever runs, and the final answer goes through the sam
AI 资讯
RFLCT: Bringing Runtime Type Metadata to TypeScript 7
If you've built large-scale applications in TypeScript, chances are you've used a Dependency Injection (DI) container. As the creator of InversifyJS, I've spent years thinking deeply about inversion of control, decoupling, and how to make enterprise patterns feel natural in TypeScript. But for all those years, there has been a glaring elephant in the room: our heavy reliance on experimentalDecorators and emitDecoratorMetadata . These compiler flags have served us well, but they are exactly that— experimental . They tie us to legacy decorator implementations, require specific compiler configurations, and often feel like a magic black box that doesn't perfectly align with modern build pipelines. I've spent a lot of time recently thinking about how we could finally drop these flags entirely while keeping the developer experience pristine. With the release of TypeScript 7, I'm thrilled to introduce the solution: 🪞 RFLCT . What is RFLCT? RFLCT is an ahead-of-time (AOT) reflect metadata injector for TypeScript 7. It injects design:symbols and design:arguments directly at build time. Zero decorators. Zero emitDecoratorMetadata . It integrates seamlessly with virtually any build tool (Vite, Rollup, webpack, esbuild) via unplugin , or you can use the built-in CLI using the TypeScript 7 API for standalone tsgo projects. Let's look at how it actually feels to write code with RFLCT. The Magic: Before and After With RFLCT, you annotate the types you want to expose to your runtime metadata using a special Reflect<T> wrapper type. What you write: import { Reflect , resolve } from " rflct " ; interface Shape { sides : number ; } class Polygon { constructor ( public shape : Reflect < Shape > , public label : Reflect < string , { optional : true } > ) {} } // resolve<T>() → the runtime identity of T (Symbol for interfaces, class for classes) container . bind ( resolve < Shape > ()). to ( Polygon ); What RFLCT compiles it to: Notice how the interfaces are safely converted into global
AI 资讯
NutriApp: uma plataforma que conecta profissional com paciente
O NutriApp é um projeto de estudos: plataforma de saúde conectando pacientes, nutricionistas, médicos e personal trainers, cada perfil enxergando só o que sua permissão libera. Stack: React 19 + TypeScript, TanStack Start (SSR, rotas file-based e server functions), Tailwind v4 + shadcn/ui, react-hook-form + Zod para formulários tipados, TanStack Query para cache, e Lovable Cloud (Supabase) com Postgres e Row Level Security. O maior desafio foi o controle de acesso por papéis. Três tabelas centrais — profiles, user_roles e pacientes — todas com RLS ativado. Paciente lê só seus próprios registros; profissionais e administradores enxergam todos os pacientes. Pra evitar recursão de política (problema clássico de RLS), criei funções SECURITY DEFINER como has_role e is_profissional, quebrando o ciclo de verificação. Autenticação e segurança: Login por email/senha, com rota administrativa separada (/admin/login) Server functions protegidas com requireSupabaseAuth, checando papel antes de qualquer ação administrativa Validação client-side com Zod: senha entre 6-72 caracteres, email até 255, telefone opcional Usuários criados por admin já nascem confirmados e ativos, reduzindo fricção operacional Automação como diferencial: o perfil de saúde calcula IMC em tempo real e gera um plano inicial baseado no objetivo selecionado (emagrecimento, ganho de massa ou controle de patologias) — reduzindo trabalho manual do profissional. Aprendizados principais: RLS bem modelado desde o início evita gambiarra depois — pensar em papéis antes da primeira quere economiza retrabalho. Verificação de papel precisa estar no backend, nunca só na UI. Separar login de paciente/profissional do login admin simplifica segurança e UX ao mesmo tempo.
开源项目
🔥 caelestia-dots / caelestia - A fluid, morphing interface to your Linux desktop
GitHub热门项目 | A fluid, morphing interface to your Linux desktop | Stars: 4,108 | 128 stars this week | 语言: TypeScript
开源项目
🔥 DefinitelyTyped / DefinitelyTyped - The repository for high quality TypeScript type definitions.
GitHub热门项目 | The repository for high quality TypeScript type definitions. | Stars: 51,405 | 38 stars this week | 语言: TypeScript
开源项目
🔥 honojs / hono - Web framework built on Web Standards
GitHub热门项目 | Web framework built on Web Standards | Stars: 31,969 | 258 stars this week | 语言: TypeScript
开发者
Learn Valid Parentheses, Reverse Linked List, and Tree Max Depth with Step-by-Step Visualization in DSA View View 👀👀
Hoi hoi! I’m @nyaomaru, a frontend engineer who struggles to make game sounds. 😿 Have you used DSA...
AI 资讯
Node.js API Key Text Classification: JSON Validation Before Multi-Provider Gateway Failover
Short answer: For private knowledge-base tagging, compare a multi-provider LLM gateway by valid, policy-compliant classifications per unit of spend, not by the cheapest advertised token rate. One API key reduces credential and adapter work, but JSON mode is only a transport promise; your Node.js boundary still needs to parse, validate, reject, and selectively retry every answer. The decision rule is blunt: keep the gateway only if the same frozen evaluation set produces acceptable labels and schema-valid JSON across the model routes you will actually enable. Otherwise, use direct provider adapters and accept the extra config. What changed the gateway choice? A private developer-tools knowledge base sounds like a small classification job. Give each document one primary tag, a confidence value, and a short reason. The awkward part is that a syntactically valid object can still be wrong: confidence may be a string, a tag may fall outside the approved taxonomy, or the model may classify instructions embedded in a document instead of classifying the document itself. JSON mode doesn't settle any of those cases. So I would benchmark the boundary, not the demo. The fixture set should contain ordinary docs, empty bodies, ambiguous release notes, code-heavy pages, and text that tries to redirect the classifier. Freeze the prompt, taxonomy, expected acceptance rules, and model identifiers for each run. Then record parse success, schema success, allowed-tag success, agreement with reviewed labels, latency, and total billed usage. I'm not sure which route wins on a particular corpus; nobody can know without those reviewed labels and current billing data. Your mileage may vary. This is where “cheapest routing” gets slippery. A low-cost response that fails validation and consumes a retry isn't cheap. A fallback that returns valid JSON but changes the label is not recovery either — it is an observable classification decision that needs its own test. Short version: benchmark accepte
AI 资讯
Whole-Ad Product Swap: Deterministic Planning First, Model Only Where Forced
Variant Multiplier already let an editor swap one section of a winning ad and keep the rest. The next request from a real production job — replacing product SL-603 with SL-808, a different hearing-aid SKU, across an entire finished ad — was a different shape of problem. It's not "change one section," it's "change every mention of the product, everywhere it appears, while keeping literally everything else the same." Two direct quotes from the editor drove the whole five-PR arc: the transcript editing was too rigid for word-by-word changes, and separately, "the music, voice, etc. should retain the same, we should keep the quality the same, and not make it do a lot of changes." If a re-render can degrade something the editor explicitly asked to keep untouched, the render path is wrong for the job — no matter how good the model is. The cheap fix first: let editors actually edit PR #67 shipped before any product-swap work started, because it was the cheap, high-value half of the same feedback: "I am just able to select word by word here but I am not really able to change the whole sentence a lot easier," and separately, "I'm able to double click on these words and then just type it in." Both were UI gaps in the transcript editor, not pipeline gaps — selecting by sentence or scene instead of only by word, and retyping a line verbatim instead of only substituting individual words. Shipping this first, standalone, meant the harder product-swap work that followed didn't also have to carry an unrelated UX fix in its diff. A product catalog the tool never had PR #69, stacked directly on top of the transcript work, is pure groundwork with no user-visible feature of its own: a product catalog, because Variant Multiplier had no concept of "a product" at all before this. The editor's own framing made the requirement explicit: "have a product selection right here, for Pro Bluetooth, for [the other SKU], and maybe other tons of products" going forward. The catalog data itself is mai
AI 资讯
From community review to a shipped security hardening with Codex
I’ve been building a small open-source TypeScript toolkit called Tenant Evidence Kit for private, multi-tenant evidence workflows on Supabase. The project started from a very specific problem: How do you attach photos, documents, or other evidence to a business object without making files public, leaking tenant data, or duplicating authorization logic across the application? The toolkit keeps that infrastructure deliberately small and domain-agnostic. It currently provides: private Supabase Storage; evidence metadata separated from file bytes; tenant isolation with Row Level Security; short-lived signed URLs; compensating cleanup when metadata persistence fails; reference migrations for tenant membership and evidence authorization. But the interesting part of the latest release was not the original implementation. It was the review loop. A community review found real problems I shared the project with the Supabase community and received a detailed security review. The feedback raised several important questions: roles existed, but authorization was still too close to flat membership; evidence deletion needed a more explicit privilege boundary; the lack of UPDATE support needed to be intentional rather than accidental; RLS assumptions around service_role , table owners and BYPASSRLS needed to be documented; authorization needed behavioral tests, not only static SQL assertions. That feedback was good enough that I didn’t want to treat it as a documentation exercise. I turned it into an implementation task. Using Codex as the implementation loop Instead of asking Codex something broad like: “Improve the security.” I gave it a tightly scoped issue with explicit acceptance criteria. The workflow became: community review → scoped issue → Codex implementation → human review → correction pass → CI → release The first implementation was useful, but the review still found problems. For example, it initially changed existing INSERT behavior and modified only the original migra