mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
cdf90d5a38
* Rename Workflow DevKit to Workflow SDK, remove beta badge, add tweet wall - Rename "Workflow DevKit" to "Workflow SDK" across all files (~108 files) - Rename standalone "WDK" references to "Workflow SDK" - Remove beta badge from homepage hero - Add tweet wall component to homepage with 4 builder testimonials Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Rename Workflow DevKit to Workflow SDK, remove beta badge, add tweet wall - Rename "Workflow DevKit" to "Workflow SDK" across all files (~108 files) - Rename standalone "WDK" references to "Workflow SDK" - Remove beta badge from homepage hero - Add tweet wall component to homepage with 4 builder testimonials Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com> * Address review: fix missed trigger phrase renames and bump skill versions - Rename "workflow devkit" to "workflow sdk" in trigger phrases for both skill files - Bump workflow-init SKILL.md version to 1.1 - Bump workflow SKILL.md version to 1.5 - Note: CLAUDE.md is a symlink to AGENTS.md, already renamed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com> * link correct tweet --------- Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Karthik Kalyanaraman <karthik.kalyanaraman@vercel.com>
74 lines
1.8 KiB
HTML
74 lines
1.8 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Workflow SDK + Nitro Example</title>
|
|
<style>
|
|
textarea {
|
|
width: 100%;
|
|
height: calc(100vh - 140px);
|
|
max-height: calc(100vh - 140px);
|
|
box-sizing: border-box;
|
|
padding: 8px;
|
|
font-family: monospace;
|
|
font-size: 14px;
|
|
resize: none;
|
|
overflow: auto;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<h1>Workflow SDK + Nitro + Vite</h1>
|
|
<hr />
|
|
<textarea id="output" readonly placeholder="output"></textarea>
|
|
</body>
|
|
<script type="module">
|
|
const outputEl = document.getElementById("output");
|
|
|
|
const { runId } = await fetchAndLog('/api/trigger?workflowFile=workflows/0_demo.ts&workflowFn=calc&args=2', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: "",
|
|
});
|
|
|
|
if (runId) {
|
|
log('Getting workflow status with runId:', runId);
|
|
await fetchAndLog(`/api/trigger?runId=${runId}`);
|
|
}
|
|
|
|
// --- debug utils ---
|
|
|
|
function log(...args) {
|
|
outputEl.textContent += args.map(arg => typeof arg === 'string' ? arg : JSON.stringify(arg)).join(" ") + "\n";
|
|
}
|
|
|
|
function tryFormatJSON(text) {
|
|
try {
|
|
return JSON.stringify(JSON.parse(text), null, 2);
|
|
} catch {
|
|
return text;
|
|
}
|
|
}
|
|
|
|
async function fetchAndLog(input, init) {
|
|
try {
|
|
const req = new Request(input, init);
|
|
log(`[${req.method}] ${input}`);
|
|
const res = await fetch(req);
|
|
const text = await res.text();
|
|
if (res.ok) {
|
|
log("Response:", tryFormatJSON(text));
|
|
return JSON.parse(text);
|
|
} else {
|
|
log("Error", res.status, res.statusText, tryFormatJSON(text));
|
|
}
|
|
} catch (error) {
|
|
log("Fetch error:", error.toString());
|
|
}
|
|
return {}
|
|
}
|
|
</script>
|
|
</html>
|