Feat v0.7.6 code hygiene (#60)
All checks were successful
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m48s
CI/CD / build-and-deploy (push) Successful in 25s
CI/CD / test-sqlite (push) Successful in 2m55s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #60.
This commit is contained in:
2026-04-02 17:39:41 +00:00
committed by xcaliber
parent 5e830c04de
commit e02b13dc12
22 changed files with 850 additions and 144 deletions

View File

@@ -668,10 +668,10 @@ type WorkflowLandingPageData struct {
// The middleware (AuthOrSession) has already created/resumed the session.
func (e *Engine) RenderWorkflow() gin.HandlerFunc {
return func(c *gin.Context) {
channelID := c.GetString("channel_id")
// :id is the public entry token (from /w/:id)
channelID := c.Param("id")
sessionID := c.GetString("session_id")
// Load channel metadata
var title, description string
if title == "" {
title = "Workflow"

View File

@@ -474,7 +474,7 @@
}
try {
var resp = await fetch(BASE + '/api/v1/w/' + CHAN_ID + '/form-submit', {
var resp = await fetch(BASE + '/api/v1/public/workflows/advance/' + CHAN_ID, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ data: data }),
@@ -561,11 +561,8 @@
addMessage('user', text, '{{.Data.SessionName}}');
try {
var resp = await fetch(BASE + '/api/v1/w/' + CHAN_ID + '/completions', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ channel_id: CHAN_ID, content: text, stream: false }),
});
// TODO(v0.8+): form_chat completions endpoint not yet implemented
var resp = { ok: false, statusText: 'Chat mode not yet available', json: function() { return Promise.resolve({ error: 'Chat mode not yet available' }); } };
if (resp.ok) {
var data = await resp.json();
if (data.content) {
@@ -627,7 +624,7 @@
html += '<h3 style="margin-bottom:16px">Collected Data</h3>';
try {
var resp = await fetch(BASE + '/api/v1/channels/' + CHAN_ID + '/workflow/status', {
var resp = await fetch(BASE + '/api/v1/public/workflows/resume/' + CHAN_ID, {
headers: { 'Content-Type': 'application/json' },
});
if (resp.ok) {
@@ -684,7 +681,7 @@
document.getElementById('reviewAdvanceBtn').addEventListener('click', async function() {
this.disabled = true;
try {
var r = await fetch(BASE + '/api/v1/channels/' + CHAN_ID + '/workflow/advance', {
var r = await fetch(BASE + '/api/v1/public/workflows/advance/' + CHAN_ID, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ data: {} }),
});
@@ -705,9 +702,9 @@
if (!reason) return;
this.disabled = true;
try {
var r = await fetch(BASE + '/api/v1/channels/' + CHAN_ID + '/workflow/reject', {
var r = await fetch(BASE + '/api/v1/public/workflows/advance/' + CHAN_ID, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ reason: reason }),
body: JSON.stringify({ data: { _action: 'reject', reason: reason } }),
});
if (r.ok) {
actionPanel.innerHTML = '<div style="padding:40px;text-align:center"><h3>Rejected</h3><p style="color:var(--text-2)">Sent back for revision.</p></div>';