@yanolja-next/noya-sdk
v0.1.8
Published
Production issue reports into pre-triaged tickets and local draft PR artifacts.
Downloads
61
Keywords
Readme
Noya
Production issue reports into pre-triaged Jira tickets and ready-to-review PRs.
This repository contains a local Node.js + TypeScript MVP:
- Browser SDK wrapper entry point:
src/sdk.ts - Backend orchestrator and dashboard:
src/server.ts,public/ - Customer runner:
src/runner.ts - Local issue and draft PR artifacts by default
- Optional GitHub/Jira issue providers when explicitly configured with token environment variables
- GitHub/Jira issues receive a fix-result comment after local draft PR creation
- Project integration config rejects inline credentials; use
*_envsettings for token/secret references - Optional telemetry event lookup when a project has provider integration settings
- Optional provider webhook HMAC verification via
integrations.telemetry.webhook_secret_env - SDK session recording wiring with optional Replay/Feedback integration registration
- Optional runner Bearer authentication via project
runner.token_env - Approved fix command refs for local Claude Code/agent execution, with shell-free process spawning, isolated repo checkout, and local draft PR artifacts
- Checkout status and patch artifacts are attached to local draft PR output when an approved agent changes files
- Artifact serving is constrained to each project's
artifact_dir - Optional dashboard/admin artifact protection via
NOYA_ADMIN_TOKEN - Optional Next Hub OIDC login for dashboard/admin endpoints via
NOYA_NEXTHUB_ISSUERandNOYA_NEXTHUB_CLIENT_ID - Project-level artifact retention cleanup via
POST /api/projects/:project_key/retention/cleanup - Idempotent manual fix approval so repeated clicks do not create duplicate jobs
- Audit entries for individual collector policy decisions and fix agent command execution
- SDK network correlation for
x-request-id,x-trace-id, andtraceparent - SDK/provider screenshot URLs are preserved as issue evidence
- Telemetry breadcrumbs are surfaced in compiled issue bodies
- Runner lease timeout/requeue and collector
max_entries/max_byteslimits - Server-side validation for collect/fix runner completion payloads
- No-runner flow creates an immediate issue with unavailable internal context clearly marked
- Dashboard links for local issue and draft PR artifacts
- Dashboard readiness checks for artifact storage, runner repo, tokens, and issue providers
- Dashboard project config editor with server-side validation
- Project edits preserve immutable
created_atmetadata - agency-platform customer sample:
examples/agency-platform/
The local implementation intentionally does not deploy, push, merge, or write to production systems. The PR flow creates a local draft PR artifact for review. External issue providers are opt-in and are covered by mock-server tests.
Run Locally
npm install
npm run build
npm startOpen http://localhost:3456.
To simulate the customer runner once:
npm run runner -- examples/agency-platform/noya.runner.jsonIf the project is configured with runner.token_env, export the same token
before running the runner:
export NOYA_AGENCY_PLATFORM_RUNNER_TOKEN=local-runner-tokenTo protect dashboard, local artifact, project config, retention cleanup, and fix approval endpoints in a shared local environment without Next Hub:
export NOYA_ADMIN_TOKEN=local-admin-tokenThe dashboard sends this token from localStorage.noya_admin_token when set.
This is an operator fallback, not something service users should create or
handle.
For browser login through Next Hub, register Noya as a confidential OIDC client in Next Hub and set:
export NOYA_NEXTHUB_ISSUER=https://auth.hub.ynext.cloud
export NOYA_NEXTHUB_CLIENT_ID=noya
export NOYA_NEXTHUB_CLIENT_SECRET=client-secret-from-next-hub
export NOYA_NEXTHUB_REDIRECT_URI=https://<noya-host>/auth/callbackSet NOYA_NEXTHUB_REDIRECT_URI to the exact URI registered in Next Hub. No admin token is required
for this setup. NOYA_ADMIN_TOKEN can stay enabled only as an operator/API
break-glass fallback; authenticated Next Hub sessions use an HttpOnly
noya_session cookie. Public PKCE clients are supported, but the recommended
production setup matches AMUX: confidential client plus PKCE. If you choose a
public PKCE client, also set NOYA_AUTH_COOKIE_SECRET.
If the Next Hub discovery endpoint is not public, set the OIDC endpoints explicitly:
export NOYA_NEXTHUB_AUTHORIZATION_ENDPOINT=https://auth.hub.ynext.cloud/oauth/authorize
export NOYA_NEXTHUB_TOKEN_ENDPOINT=https://auth.hub.ynext.cloud/oauth/token
export NOYA_NEXTHUB_USERINFO_ENDPOINT=https://auth.hub.ynext.cloud/oauth/userinfo
export NOYA_NEXTHUB_JWKS_URI=https://auth.hub.ynext.cloud/.well-known/jwks.jsonVerify
npm test
npm run test:e2enpm run test:e2e starts the orchestrator, submits an agency-platform sample
report, runs collect mode, approves a local fix from the dashboard in headless
Chrome, runs fix mode, and verifies that a local draft PR artifact was created.
It also verifies telemetry webhook intake, collector policy denial for raw command
collectors, telemetry event lookup, GitHub/Jira providers against local mock
servers, approved fix command execution, runner heartbeat/fail lifecycle, and
runner Bearer authentication. npm test also verifies provider webhook signature
checks, stale runner lease requeue, collector output limits, duplicate issue
linking, idempotent fix approval, collector/agent audit entries,
browser-visible artifact links, readiness checks, SDK request correlation,
project config validation, context redaction, and recording tag/context wiring.
It also checks artifact retention cleanup and artifact path boundary enforcement.
Optional admin-token protection is covered by API tests.
