Voice Iterate Widget (preview)
Repository contains embeddable Web Component that captures typed or browser-transcribed instruction, submits to owned OpenFactory app, polls resulting repair ticket. Integration preview-only.
Package source in tools/voice-iterate in OpenFactory monorepo. Do not assume @openfactory/voice-iterate or CDN bundle publicly published; build and pin reviewed artifact from repository until release explicitly listed in package registry.
Current boundary
Endpoint accepts instruction for app with Git source and dispatches shared repair workflow. Stage 0 changes deployed sandbox copy and can redeploy preview. Does not guarantee change committed to upstream repository. Ticket marked done proves only recorded agent task outcome; review result and verify app yourself.
Service allows at most two in-flight iterations per app. Additional requests return 429 until ticket reaches terminal state.
Prerequisites
- Owned OpenFactory app with
source.git_url. - Real account; guest sessions cannot dispatch autonomous code edits.
of_mcp_account key kept on server, never in browser JavaScript.- HTTPS or localhost development origin if microphone input used.
Build widget from source
From monorepo:
cd tools/voice-iterate
npm ci
npm test
npm run lint
npm run buildVendor resulting versioned bundle or install from own controlled registry. Record source commit and checksum used by application.
Use same-origin proxy
Browser-facing widget calls:
POST {endpoint}/iterate
GET {endpoint}/agent-status
GET {endpoint}/agent-status?thread_id={thread_id}Server should pin target app ID and forward those requests to:
POST https://console.openfactory.tech/api/apps/{APP_ID}/iterate
GET https://console.openfactory.tech/api/apps/{APP_ID}/agent-statusAttach Authorization: Bearer <of_mcp_key> only on server. Authenticate and rate-limit own proxy users; otherwise every visitor able to reach route can spend account authority on changes to pinned app. Allow only three paths and two methods above, enforce request-size limits, do not forward arbitrary headers or app IDs.
Mount locally built module with proxy endpoint:
import { createVoiceIterate } from './vendor/openfactory-voice-iterate/index.mjs';
const widget = createVoiceIterate({
appId: '550e8400-e29b-41d4-a716-446655440000',
endpoint: '/api/voice-iterate',
fallback: 'text',
onStatusChange: ({ status, thread }) => {
console.log(status, thread.taskResult);
},
});Custom element and styles run in Shadow DOM. Default text fallback remains usable when browser speech recognition unavailable. Browser speech services and privacy behavior vary by browser and deployment; obtain consent and test exact supported browser set. OpenFactory receives resulting text on this path, while browser or configured speech service may process audio separately.
Acceptance test
- Submit harmless, reversible change against non-production app.
- Confirm proxy cannot target any other app and rejects unauthenticated callers.
- Observe
queued/workingthrough terminaldone,failed,lost, orstalestate. - Inspect task result and preview manually.
- Confirm upstream Git repository unchanged unless separate, reviewed source-persistence workflow reports commit or pull request.
- Revert or rebuild sandbox from canonical source.
See Prompt-to-app agent and App deployment for same persistence and promotion boundaries.