Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

724 B
Raw Blame
#!/usr/bin/env node
import { main } from '../src/main.js'
import { cancel } from '../src/plugins/commands/cancel.js'

const EPIPE = 'EPIPE'

// SIGINT unwinds the run through the shared controller; the exit code is whatever
// the command settles on, since 130 is outside the frozen taxonomy.
process.once('SIGINT', cancel)

// A reader that closed stdout (`| head`) still emits on the stream after the write
// callback has already reported it. Swallowing only EPIPE keeps that from turning a
// finished run into an unhandled 'error' event.
process.stdout.on('error', (err: NodeJS.ErrnoException) => {
  if (err.code !== EPIPE) throw err
})

void (async () => {
  process.exitCode = await main(process.argv.slice(2))
})()