loopengine 0.3.98 → 0.3.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/system-agents/goal-planner.d.ts +4 -2
- package/dist/core/system-agents/goal-planner.js +11 -3
- package/dist/web/agents-config-page.js +4 -4
- package/dist/web/console-shell.js +7 -20
- package/dist/web/dev-ui-styles.js +0 -1
- package/dist/web/goals-admin.js +2 -1
- package/dist/web/goals-page.js +5 -1
- package/dist/web/inbox-page.js +12 -1
- package/dist/web/workflows-overview-page.js +2 -10
- package/package.json +1 -1
|
@@ -139,12 +139,14 @@ export interface GoalPipelineInput {
|
|
|
139
139
|
goal: string;
|
|
140
140
|
context: GoalContext;
|
|
141
141
|
saved?: SavedGoalWorkflow[];
|
|
142
|
+
/** Setup steps the goal already lists, from earlier rounds. */
|
|
143
|
+
setup?: string[];
|
|
142
144
|
/** The focus the person chose, instead of the one the brief reads. */
|
|
143
145
|
focus?: GoalFocus | 'other';
|
|
144
146
|
}
|
|
145
147
|
export declare const GOAL_BRIEF_PROMPT = "You read a goal someone gives LoopEngine, a platform of AI agents that work with information and software: they search, read, write, draft, track, and act in connected apps (email, chat, stores, CRMs, payments, code hosts). They can't do physical work or run large real-world projects on their own.\n\nCall save_brief once:\n- scope: \"in\" when agents can do the work that drives the goal, even though people make the final choice (signups, downloads, sales, donations, replies are all \"in\"); \"partial\" only when the core of the goal is physical or offline action the person must do themselves (building, training, travelling), so agents can only do the information work around it; \"out\" when there is nothing useful an agent could do. scopeReason: one sentence.\n- reading: how you read it. When the wording could be a metaphor (\"land on the moon\", \"climb Everest\" said of a business), prefer the reading the context supports and say which.\n- focus: the one stage of the goal to plan for, from the focuses listed in the request. Growth of users means \"new-signups\" unless the goal speaks of using, keeping or activating people. Answering customers sooner is \"faster-support\". When none fits, focus \"other\" and newFocus: name the stage in a few generic words (label, e.g. \"Hiring\", \"Closing sales deals\", \"Personal health habits\") with a one-sentence hint of what goals with this focus are about. No names of the business, its products, people or places.\n- measure: the number that shows progress, in the person's terms, with what is known about its current value (\"unknown\" when it isn't).\n- measureSource: the system in the context that holds that number (\"none\" when no system does), and measureSourceConnected: true only when the context lists that system as connected.\n- qualifiers: what the goal singles out beyond its main outcome, in its own words (\"mostly small e-commerce shops\", \"especially refunds\", \"this Christmas\"); empty when it singles out nothing.\n- profile: what makes this goal different from others with the same focus. metric: the number it moves; direction: \"up\", \"down\", \"reach\" (a milestone) or \"keep\"; constraints: limits that rule approaches out (no budget, night shifts, vegetarian, an injury, only one market), from the goal and the context, empty when none; timeframe (\"by March\", \"unknown\"); startingPoint (first try, tried before, what's already in place, or \"unknown\"); bottleneck: what's most likely to stop this particular goal (for most weight goals it's sticking with it; for a new product it may be that nobody knows it exists), and bottleneckWhy in a sentence.\n- A listed focus is the same focus when the goal is the same kind of work, even worded differently or aimed the other way (losing and gaining weight; hiring support staff and hiring engineers): use it rather than naming a new one.\n- audience, weeklyHours (from the context, else 3), approvals (from the context's rules, else \"nothing is posted, sent or published without approval\").";
|
|
146
|
-
export declare const GOAL_PLAN_PROMPT = "You plan workflows for a confirmed goal brief in LoopEngine. Each workflow is one recurring job for one AI agent; a person reviews what it drafts.\n\nRules:\n1. Levers first, capabilities second. Choose what moves this focus's measure (the playbook's levers, or your own when the context calls for one), then map each to what the workspace has. Never start from what the connected tools could do.\n1b. When the request lists no playbook levers for this focus (none yet, or every one already under this goal), write the levers you need first, in newLevers (two to five), then make each workflow from one of them (its leverId is the lever's key). When levers are listed but one this goal clearly needs is missing, you may add up to two. A new lever is like the playbook's: one distinct approach (one reason it works), in generic words that fit many goals of this focus (no names of this business, its products, people, places or sites; no direction, target or amount when the approach works either way: \"a weekly meal routine toward the target\", not \"eat less\"), with when it fits and doesn't, what it needs, review time, how its effect shows up, guardrails (approval before anything is sent, posted or published), and a generic template with {placeholders}. The workflow's request is where this business's specifics go.\n2. Every workflow serves the brief's focus directly and moves its measure. Workflows that only support it (reporting, onboarding for an acquisition goal, support) go in leftOut with a reason, not in workflows.\n3. One lever per workflow, named in a few generic words (no business, product, person, place or site names: \"list in app marketplaces\", not \"list Wick & Ember on Shopify\"); no two workflows on the same lever. Never propose a lever already saved under the goal (built, proposed or dismissed): those are listed in the request.\n3b. Choose levers for this goal, not for the focus in general. Look at every lever listed: rule out one whose \"not when\", needs or the profile's constraints don't fit; prefer the ones that address the profile's bottleneck; pick ones that work in different ways (not three kinds of tracking). In considered, list every lever you looked at with chosen or ruled_out and a short reason tied to this goal (\"addresses sticking with it\", \"no gym: ruled out\"). Reuse a listed lever whenever its approach fits, even if it was written for a goal aimed the other way: put what's specific to this goal (the direction, the target, the details) in the workflow's request. Write a new lever only for what no listed lever covers.\n4. Three to five workflows for an \"in\" goal, ordered by impact against effort, quickest useful one first; startsAfter when one depends on another. Their humanMinutesPerWeek together stay within three quarters of the brief's weeklyHours, so the plan survives a busy week.\n4b. Each one is a job: kind \"recurring\" when it runs again and again (a weekly scan, a reply to each signup), kind \"once\" for work on a finite list or done one time (submitting to a set of directories, a one-time audit, researching a list of communities). A once job is done by an agent once, in Chat; never make it a weekly job that runs out of things to do.\n4c. measure: the job's own number, in the person's terms, that shows it's working (\"replies per week\", \"signups tagged ref=directories\"); for a once job, what done looks like (\"done when: listed in 15 directories\"). A playbook lever says the kind and measure it usually has: start from those, and change them only when the context calls for it.\n4d. title: the result the job brings, in plain words, at most six words: \"Reach new leads every week\", \"Get new signups started\", \"Answer refund requests the same day\", \"Get listed in 15 startup directories\". Short enough to read at a glance on a card, keeping the one detail that tells it apart from other jobs (where or who: \"Answer AI-agent questions on Reddit\"); the other details (which leads, which communities, what counts) go in measure, why and request, not the title. Not the mechanism that does it (\"Lead scan\", \"Send welcome emails\"): that's the name of the workflow that does the job, written later and shown under it.\n5. Specific to this context: name the person's own communities, systems, products and channels in each request. A request anyone could use unchanged is wrong.\n6. needs: what each workflow uses, each with a kind from the playbook's vocabulary and connected true only when the context lists that kind as connected.\n7. Every request that posts, sends or publishes says nothing goes out without the person's approval.\n8. The measure must be readable. When measureSourceConnected is false, setup says how the number will be read: connecting that source (name it, e.g. \"connect Clerk's user.created webhook so signups and their ref are recorded\"), or, when it can't be connected, a light manual record the person updates weekly (kept with the Records ability). Always record a baseline: the number today. Tag what workflows produce (ref=<channel>) so each one's effect can be told apart.\n8b. Every qualifier in the brief is covered by at least one workflow that addresses it directly; list it in that workflow's covers.\n9. \"partial\" scope: at most three workflows, only ones that help the person pursue the goal, and say so in the message (\"helps you pursue\", never \"achieves\"). \"out\" scope: no workflows; the message says plainly why, and offers a smaller or related goal.\n10. agent: an existing agent's exact name when its work fits. When none fits, or there are no agents yet, suggest a new one: agent and newAgent.name the same short lowercase name with hyphens (e.g. \"community-agent\"), and newAgent.instructions two or three sentences on what it does and how it behaves. Group workflows that belong together in one agent rather than one agent each.\n\nCall save_plan once.";
|
|
147
|
-
export declare const GOAL_CRITIQUE_PROMPT = "You check a goal plan against its rules before a person sees it. List every issue (be strict, quote the workflow):\n- a workflow that doesn't serve the brief's focus or move its measure;\n- two workflows on the same lever, or one repeating a lever already saved;\n- a request generic enough to fit any business;\n- a need marked connected that the context doesn't list as connected;\n- a request that posts, sends or publishes without saying it waits for approval;\n- review time over three quarters of the weekly budget;\n- a measure whose source isn't connected, with no setup step that connects it or a manual record, or no baseline;\n- a qualifier from the brief no workflow addresses;\n- a recurring job on a finite list that will run out (it should be kind \"once\");\n- a job title longer than six words, or one that names the mechanism (\"Send welcome emails\", \"Lead scan\") instead of the result it brings (\"Get new signups started\");\n- a lever in newLevers that names this business, its products, people, places or sites, mixes several approaches, or has no way to see its effect;\n- a workflow made from no lever when the request listed none for this focus (it should come from one of newLevers);\n- a plan claiming to achieve a goal that is only partly in scope, or workflows for an out-of-scope goal.\nCall save_review once: passed true only when there are no issues.";
|
|
148
|
+
export declare const GOAL_PLAN_PROMPT = "You plan workflows for a confirmed goal brief in LoopEngine. Each workflow is one recurring job for one AI agent; a person reviews what it drafts.\n\nRules:\n1. Levers first, capabilities second. Choose what moves this focus's measure (the playbook's levers, or your own when the context calls for one), then map each to what the workspace has. Never start from what the connected tools could do.\n1b. When the request lists no playbook levers for this focus (none yet, or every one already under this goal), write the levers you need first, in newLevers (two to five), then make each workflow from one of them (its leverId is the lever's key). When levers are listed but one this goal clearly needs is missing, you may add up to two. A new lever is like the playbook's: one distinct approach (one reason it works), in generic words that fit many goals of this focus (no names of this business, its products, people, places or sites; no direction, target or amount when the approach works either way: \"a weekly meal routine toward the target\", not \"eat less\"), with when it fits and doesn't, what it needs, review time, how its effect shows up, guardrails (approval before anything is sent, posted or published), and a generic template with {placeholders}. The workflow's request is where this business's specifics go.\n2. Every workflow serves the brief's focus directly and moves its measure. Workflows that only support it (reporting, onboarding for an acquisition goal, support) go in leftOut with a reason, not in workflows.\n3. One lever per workflow, named in a few generic words (no business, product, person, place or site names: \"list in app marketplaces\", not \"list Wick & Ember on Shopify\"); no two workflows on the same lever. Never propose a lever already saved under the goal (built, proposed or dismissed): those are listed in the request.\n3b. Choose levers for this goal, not for the focus in general. Look at every lever listed: rule out one whose \"not when\", needs or the profile's constraints don't fit; prefer the ones that address the profile's bottleneck; pick ones that work in different ways (not three kinds of tracking). In considered, list every lever you looked at with chosen or ruled_out and a short reason tied to this goal (\"addresses sticking with it\", \"no gym: ruled out\"). Reuse a listed lever whenever its approach fits, even if it was written for a goal aimed the other way: put what's specific to this goal (the direction, the target, the details) in the workflow's request. Write a new lever only for what no listed lever covers.\n4. Three to five workflows for an \"in\" goal, ordered by impact against effort, quickest useful one first; startsAfter when one depends on another. Their humanMinutesPerWeek together stay within three quarters of the brief's weeklyHours, so the plan survives a busy week.\n4b. Each one is a job: kind \"recurring\" when it runs again and again (a weekly scan, a reply to each signup), kind \"once\" for work on a finite list or done one time (submitting to a set of directories, a one-time audit, researching a list of communities). A once job is done by an agent once, in Chat; never make it a weekly job that runs out of things to do.\n4c. measure: the job's own number, in the person's terms, that shows it's working (\"replies per week\", \"signups tagged ref=directories\"); for a once job, what done looks like (\"done when: listed in 15 directories\"). A playbook lever says the kind and measure it usually has: start from those, and change them only when the context calls for it.\n4d. title: the result the job brings, in plain words, at most six words: \"Reach new leads every week\", \"Get new signups started\", \"Answer refund requests the same day\", \"Get listed in 15 startup directories\". Short enough to read at a glance on a card, keeping the one detail that tells it apart from other jobs (where or who: \"Answer AI-agent questions on Reddit\"); the other details (which leads, which communities, what counts) go in measure, why and request, not the title. Not the mechanism that does it (\"Lead scan\", \"Send welcome emails\"): that's the name of the workflow that does the job, written later and shown under it.\n5. Specific to this context: name the person's own communities, systems, products and channels in each request. A request anyone could use unchanged is wrong.\n6. needs: what each workflow uses, each with a kind from the playbook's vocabulary and connected true only when the context lists that kind as connected.\n7. Every request that posts, sends or publishes says nothing goes out without the person's approval.\n8. The measure must be readable. When measureSourceConnected is false, setup says how the number will be read: connecting that source (name it, e.g. \"connect Clerk's user.created webhook so signups and their ref are recorded\"), or, when it can't be connected, a light manual record the person updates weekly (kept with the Records ability). Always record a baseline: the number today. Tag what workflows produce (ref=<channel>) so each one's effect can be told apart.\n8b. setup: what the person does once before the jobs start, at most four steps, each one short sentence (about 20 words at most) saying the action, not the reasoning. When the request lists setup already on the goal, add only what those steps don't cover, usually nothing: never repeat or reword one (the baseline, the signup link, the manual record are said once).\n8b. Every qualifier in the brief is covered by at least one workflow that addresses it directly; list it in that workflow's covers.\n9. \"partial\" scope: at most three workflows, only ones that help the person pursue the goal, and say so in the message (\"helps you pursue\", never \"achieves\"). \"out\" scope: no workflows; the message says plainly why, and offers a smaller or related goal.\n10. agent: an existing agent's exact name when its work fits. When none fits, or there are no agents yet, suggest a new one: agent and newAgent.name the same short lowercase name with hyphens (e.g. \"community-agent\"), and newAgent.instructions two or three sentences on what it does and how it behaves. Group workflows that belong together in one agent rather than one agent each.\n\nCall save_plan once.";
|
|
149
|
+
export declare const GOAL_CRITIQUE_PROMPT = "You check a goal plan against its rules before a person sees it. List every issue (be strict, quote the workflow):\n- a workflow that doesn't serve the brief's focus or move its measure;\n- two workflows on the same lever, or one repeating a lever already saved;\n- a request generic enough to fit any business;\n- a need marked connected that the context doesn't list as connected;\n- a request that posts, sends or publishes without saying it waits for approval;\n- review time over three quarters of the weekly budget;\n- a measure whose source isn't connected, with no setup step (new or already on the goal) that connects it or a manual record, or no baseline;\n- more than four setup steps, a step longer than a sentence, or one that repeats or rewords a step already on the goal;\n- a qualifier from the brief no workflow addresses;\n- a recurring job on a finite list that will run out (it should be kind \"once\");\n- a job title longer than six words, or one that names the mechanism (\"Send welcome emails\", \"Lead scan\") instead of the result it brings (\"Get new signups started\");\n- a lever in newLevers that names this business, its products, people, places or sites, mixes several approaches, or has no way to see its effect;\n- a workflow made from no lever when the request listed none for this focus (it should come from one of newLevers);\n- a plan claiming to achieve a goal that is only partly in scope, or workflows for an out-of-scope goal.\nCall save_review once: passed true only when there are no issues.";
|
|
148
150
|
/** A job a person added in their own words, shaped like a planned one. */
|
|
149
151
|
export declare const GOAL_ADD_JOB_PROMPT = "A person adds a job of their own to a goal in LoopEngine, in their own words. Shape it into one job like a planner's, and judge it honestly; it's their business, so advise, don't lecture.\n\nShape it:\n- title: the result the job brings, in plain words, at most six words (\"Get weekly sales to the team\", \"Answer customer emails within an hour\"). When the person wrote a long or mechanism-style idea (\"send a weekly sales summary to the team every Monday\"), keep their meaning and the detail that sets it apart (where or who) in a short title, and put the details in measure and request; the mechanism becomes the workflow's name later.\n- kind (\"recurring\" when it repeats, \"once\" for finite work), measure (its own number, or for a once job what done looks like), why it moves the goal (mechanism), the agent (an existing agent's exact name when its work fits, else newAgent with a short name and two or three sentences of instructions), needs (connected only when the context lists it), humanMinutesPerWeek, and a request specific to this business that the agent can act on. Anything that posts, sends or publishes says nothing goes out without the person's approval.\n- lever: when it's one of the playbook levers listed, its id in leverId. When none fits, write one generic lever in newLever (one approach, no names of this business, its products, people, places or sites; when it fits and doesn't; what it needs; how its effect shows up; guardrails; a generic template) and put its key in leverId.\n\nJudge it, in verdict:\n- \"added\": it fits the goal and is safe.\n- \"changed\": a sound idea with risky details you changed (an approval added, volume limited, a platform's rules respected); say what you changed in note.\n- \"warned\": it's safe but unlikely to move the goal's measure, repeats a job already under the goal, or is unlikely to work; say why in note and give a better-aimed alternative.\n- \"refused\": it's deceptive, illegal or against a platform's rules (fake reviews or accounts, spam, buying followers, harvesting private data, impersonation, misleading claims) or could harm people. Don't shape it; say why in note, plainly and briefly, and give a legitimate alternative.\n\nWhen there is no goal (a job added on its own), judge it on its own: \"added\" when it suits this business and is safe; \"warned\" when it's unlikely to work or repeats a job already listed. Its mechanism is what the job gets done for the business, and it has no lever: leave leverId and newLever out.\n\nCall save_job once.";
|
|
150
152
|
export interface ShapedJob {
|
|
@@ -31,6 +31,7 @@ Rules:
|
|
|
31
31
|
6. needs: what each workflow uses, each with a kind from the playbook's vocabulary and connected true only when the context lists that kind as connected.
|
|
32
32
|
7. Every request that posts, sends or publishes says nothing goes out without the person's approval.
|
|
33
33
|
8. The measure must be readable. When measureSourceConnected is false, setup says how the number will be read: connecting that source (name it, e.g. "connect Clerk's user.created webhook so signups and their ref are recorded"), or, when it can't be connected, a light manual record the person updates weekly (kept with the Records ability). Always record a baseline: the number today. Tag what workflows produce (ref=<channel>) so each one's effect can be told apart.
|
|
34
|
+
8b. setup: what the person does once before the jobs start, at most four steps, each one short sentence (about 20 words at most) saying the action, not the reasoning. When the request lists setup already on the goal, add only what those steps don't cover, usually nothing: never repeat or reword one (the baseline, the signup link, the manual record are said once).
|
|
34
35
|
8b. Every qualifier in the brief is covered by at least one workflow that addresses it directly; list it in that workflow's covers.
|
|
35
36
|
9. "partial" scope: at most three workflows, only ones that help the person pursue the goal, and say so in the message ("helps you pursue", never "achieves"). "out" scope: no workflows; the message says plainly why, and offers a smaller or related goal.
|
|
36
37
|
10. agent: an existing agent's exact name when its work fits. When none fits, or there are no agents yet, suggest a new one: agent and newAgent.name the same short lowercase name with hyphens (e.g. "community-agent"), and newAgent.instructions two or three sentences on what it does and how it behaves. Group workflows that belong together in one agent rather than one agent each.
|
|
@@ -43,7 +44,8 @@ export const GOAL_CRITIQUE_PROMPT = `You check a goal plan against its rules bef
|
|
|
43
44
|
- a need marked connected that the context doesn't list as connected;
|
|
44
45
|
- a request that posts, sends or publishes without saying it waits for approval;
|
|
45
46
|
- review time over three quarters of the weekly budget;
|
|
46
|
-
- a measure whose source isn't connected, with no setup step that connects it or a manual record, or no baseline;
|
|
47
|
+
- a measure whose source isn't connected, with no setup step (new or already on the goal) that connects it or a manual record, or no baseline;
|
|
48
|
+
- more than four setup steps, a step longer than a sentence, or one that repeats or rewords a step already on the goal;
|
|
47
49
|
- a qualifier from the brief no workflow addresses;
|
|
48
50
|
- a recurring job on a finite list that will run out (it should be kind "once");
|
|
49
51
|
- a job title longer than six words, or one that names the mechanism ("Send welcome emails", "Lead scan") instead of the result it brings ("Get new signups started");
|
|
@@ -109,7 +111,7 @@ const planTool = () => ({
|
|
|
109
111
|
input_schema: {
|
|
110
112
|
type: 'object',
|
|
111
113
|
properties: {
|
|
112
|
-
setup: { type: 'array', items: { type: 'string' } },
|
|
114
|
+
setup: { type: 'array', items: { type: 'string' }, description: 'at most four short steps, only ones not already on the goal' },
|
|
113
115
|
workflows: {
|
|
114
116
|
type: 'array',
|
|
115
117
|
items: {
|
|
@@ -276,6 +278,11 @@ function leversText(focus, saved = []) {
|
|
|
276
278
|
: 'Playbook levers: none for this focus yet. Write the levers this goal needs in newLevers (rule 1b), and make each workflow from one of them.';
|
|
277
279
|
return 'Playbook levers for this focus (id: name; why; fits when; not when; needs; minutes a week):\n' + levers.slice(0, MAX_LEVERS_IN_PROMPT).map((l) => `- ${l.id}: ${l.name}. ${l.mechanism} Fits when: ${l.fitsWhen.join('; ')}. Not when: ${l.notWhen.join('; ')}. Needs: ${[...(l.needs.anyOf?.length ? [`one of ${l.needs.anyOf.join('/')}`] : []), ...(l.needs.plus ?? [])].join(' + ')}. About ${l.humanMinutesPerWeek} min/week. Usually ${l.kind === 'once' ? 'a once job' : 'a recurring job'}; its measure: ${l.measureLink}. Template: ${l.template}`).join('\n');
|
|
278
280
|
}
|
|
281
|
+
function setupText(setup) {
|
|
282
|
+
if (!setup?.length)
|
|
283
|
+
return '';
|
|
284
|
+
return 'Setup already on this goal (don\'t repeat or reword these; add only what they don\'t cover):\n' + setup.map((s) => `- ${s}`).join('\n');
|
|
285
|
+
}
|
|
279
286
|
function savedText(saved) {
|
|
280
287
|
if (!saved?.length)
|
|
281
288
|
return 'Already saved under this goal: nothing yet.';
|
|
@@ -451,13 +458,14 @@ export async function draftGoalPlan(modelCall, input, brief, issues = []) {
|
|
|
451
458
|
briefText(brief),
|
|
452
459
|
leversText(brief.focus, input.saved),
|
|
453
460
|
savedText(input.saved),
|
|
461
|
+
setupText(input.setup),
|
|
454
462
|
`The goal, as the person said it:\n${input.goal}`,
|
|
455
463
|
issues.length ? `A check found these issues in your last plan; fix every one:\n${issues.map((i) => `- ${i}`).join('\n')}` : '',
|
|
456
464
|
].filter(Boolean).join('\n\n');
|
|
457
465
|
return parsePlan(await callTool(modelCall, GOAL_PLAN_PROMPT, user, planTool()), brief.focus);
|
|
458
466
|
}
|
|
459
467
|
export async function critiqueGoalPlan(modelCall, input, brief, plan) {
|
|
460
|
-
const user = [contextText(input.context), briefText(brief), savedText(input.saved), `The plan:\n${JSON.stringify(plan, null, 2)}`].join('\n\n');
|
|
468
|
+
const user = [contextText(input.context), briefText(brief), savedText(input.saved), setupText(input.setup), `The plan:\n${JSON.stringify(plan, null, 2)}`].join('\n\n');
|
|
461
469
|
const raw = await callTool(modelCall, GOAL_CRITIQUE_PROMPT, user, REVIEW_TOOL);
|
|
462
470
|
const issues = strings(raw.issues);
|
|
463
471
|
return { passed: raw.passed === true && issues.length === 0, issues };
|
|
@@ -94,7 +94,6 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
94
94
|
.wf-row-head { display: grid; grid-template-columns: 14px minmax(0, 1fr) 210px 200px auto; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; }
|
|
95
95
|
.wf-row-head:hover, .wf-row.is-open .wf-row-head { background: var(--surface); }
|
|
96
96
|
.wf-row-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
|
|
97
|
-
.wf-slug { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; }
|
|
98
97
|
.wf-row-job { font-size: 12.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
99
98
|
.wf-row-job a { color: var(--accent-ink); }
|
|
100
99
|
.wf-row-caret { width: 7px; height: 7px; border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(-45deg); transition: transform .15s; }
|
|
@@ -123,7 +122,7 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
123
122
|
.wf-tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 10px; margin-bottom: -1px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
|
|
124
123
|
.wf-tab:hover:not(:disabled) { background: none; color: var(--ink); }
|
|
125
124
|
.wf-tab[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
|
|
126
|
-
.wf-msg-form { display: flex; flex-direction: column; gap: 14px;
|
|
125
|
+
.wf-msg-form { display: flex; flex-direction: column; gap: 14px; }
|
|
127
126
|
.wf-msg-dests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
|
|
128
127
|
.wf-msg-dest { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
|
|
129
128
|
.wf-msg-dest-k { font-weight: 600; font-size: 13px; }
|
|
@@ -583,6 +582,7 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
583
582
|
align-items: center;
|
|
584
583
|
gap: 6px;
|
|
585
584
|
}
|
|
585
|
+
form.add-source label.http-tool-inline-label[hidden] { display: none; }
|
|
586
586
|
/* These three are plain <div>s of sibling inputs/selects/buttons, not
|
|
587
587
|
<label>s, so none of the rules above touch them — without an explicit
|
|
588
588
|
row layout they just wrap at the browser's default inline spacing,
|
|
@@ -1238,7 +1238,7 @@ ${renderMarkdownScript}
|
|
|
1238
1238
|
return '<article class="workflow-card wf-row' + (open ? ' is-open' : '') + '" data-workflow="' + escapeHtml(w.id) + '">' +
|
|
1239
1239
|
'<div class="wf-row-head" role="button" tabindex="0" aria-expanded="' + open + '">' +
|
|
1240
1240
|
'<span class="wf-row-caret" aria-hidden="true"></span>' +
|
|
1241
|
-
'<div class="wf-row-main"><strong
|
|
1241
|
+
'<div class="wf-row-main"><strong>' + escapeHtml(w.title) + '</strong>' +
|
|
1242
1242
|
// The job(s) it does, linking back to each job's page.
|
|
1243
1243
|
(w.jobs && w.jobs.length ? '<span class="wf-row-job">For job: ' + w.jobs.map(function (j) { return '<a href="/jobs?job=' + encodeURIComponent(j.id) + '">' + escapeHtml(j.title) + '</a>'; }).join(', ') + '</span>' : '') + '</div>' +
|
|
1244
1244
|
'<span class="wf-row-starts">' + workflowStartsSummary(w) + '</span>' +
|
|
@@ -3355,7 +3355,7 @@ ${renderMarkdownScript}
|
|
|
3355
3355
|
? '<div class="body-field">Runs' +
|
|
3356
3356
|
'<div class="schedule-when"><input type="radio" name="runs" value="workflow" id="runsWorkflow" checked><label for="runsWorkflow">A workflow</label>' +
|
|
3357
3357
|
'<select name="workflow_id" aria-label="Workflow">' + schedulesWorkflows.map(function (w) {
|
|
3358
|
-
return '<option value="' + escapeHtml(w.id) + '">' + escapeHtml(w.
|
|
3358
|
+
return '<option value="' + escapeHtml(w.id) + '">' + escapeHtml(w.title) + '</option>';
|
|
3359
3359
|
}).join('') + '</select></div>' +
|
|
3360
3360
|
'<div class="workflow-params" id="scheduleParams" style="margin:0 0 4px 22px"></div>' +
|
|
3361
3361
|
'<p class="hint" style="margin:0 0 4px 22px">Each run follows the workflow's instructions as they are then, so changing the workflow changes what runs.</p>' +
|
|
@@ -25,12 +25,8 @@
|
|
|
25
25
|
const BRAND_MARK = '<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true">' +
|
|
26
26
|
'<path d="M3 7a4 4 0 1 0 4-4" stroke="var(--on-accent)" stroke-width="1.8" stroke-linecap="round"/>' +
|
|
27
27
|
'<path d="M7 1.2v3.6L9.2 3z" fill="var(--on-accent)"/></svg>';
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
const GOALS_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>';
|
|
31
|
-
const JOBS_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M13 13a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 6V5a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v1h2a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h2Zm2-1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1H9V5Zm10 3a1 1 0 0 1 1 1v3.5a2.5 2.5 0 0 1-2.5 2.5H6a2 2 0 0 1-2-2V9a1 1 0 0 1 1-1h14ZM4 16.465c.588.34 1.271.535 2 .535h11.5c.925 0 1.785-.28 2.5-.758V18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1.535Z"/></svg>';
|
|
32
|
-
// The robot is drawn smaller in its 24 box than the others: cropped to
|
|
33
|
-
// its middle 18, it shows at the same size.
|
|
28
|
+
// A robot for Agents. It's drawn smaller in its 24 box than the other
|
|
29
|
+
// icons: cropped to its middle 18, it shows at the same size.
|
|
34
30
|
const AGENTS_ICON = '<svg class="le-nav-icon" viewBox="3 3 18 18" fill="currentColor" aria-hidden="true"><path d="M11 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm3.5 1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5a1 1 0 0 1 1 1V7h4a3 3 0 0 1 3 3v3.5a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V10a3 3 0 0 1 3-3h4v-.5a1 1 0 0 1 1-1ZM7 9h10a1 1 0 0 1 1 1v3.5a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V10a1 1 0 0 1 1-1Z"/></svg>';
|
|
35
31
|
// Two linked steps going round, for Workflows.
|
|
36
32
|
const WORKFLOWS_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/><path d="M10 6.5h4a3.5 3.5 0 0 1 3.5 3.5v4"/><path d="M14 17.5h-4A3.5 3.5 0 0 1 6.5 14v-4"/></svg>';
|
|
@@ -38,8 +34,9 @@ const WORKFLOWS_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="none"
|
|
|
38
34
|
const INBOX_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/></svg>';
|
|
39
35
|
// A gear, for Settings.
|
|
40
36
|
const SETTINGS_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>';
|
|
41
|
-
// Two columns: the sections (Inbox,
|
|
42
|
-
//
|
|
37
|
+
// Two columns: the sections (Inbox, Agents, Workflows, Settings), and
|
|
38
|
+
// beside them what's in the current one. Goals and Jobs stay at /goals
|
|
39
|
+
// and /jobs, out of the menu: LoopEngine is about workflows. Pointing at
|
|
43
40
|
// another section shows its column instead, until the pointer leaves.
|
|
44
41
|
// Inbox and Home have no second column; pointing at a section there
|
|
45
42
|
// opens its column over the page.
|
|
@@ -47,8 +44,6 @@ export const consoleSidebarHtml = `<aside class="le-sidebar" aria-label="Console
|
|
|
47
44
|
<nav class="le-rail" aria-label="Sections">
|
|
48
45
|
<a class="le-brand" href="/" title="Home"><span class="le-brand-mark">${BRAND_MARK}</span></a>
|
|
49
46
|
<a class="le-rail-item" href="/inbox" data-le-nav-head="inbox" data-le-section="inbox">${INBOX_ICON}<span>Inbox</span><span class="le-pill warn le-inbox-count" id="leInboxCount" hidden></span></a>
|
|
50
|
-
<a class="le-rail-item" href="/goals" data-le-nav-head="goals" data-le-section="goals">${GOALS_ICON}<span>Goals</span></a>
|
|
51
|
-
<a class="le-rail-item" href="/jobs" data-le-nav-head="jobs" data-le-section="jobs">${JOBS_ICON}<span>Jobs</span></a>
|
|
52
47
|
<a class="le-rail-item" href="/agents" data-le-nav-head="agents" data-le-section="agents">${AGENTS_ICON}<span>Agents</span></a>
|
|
53
48
|
<a class="le-rail-item" href="/workflows" data-le-nav-head="workflows" data-le-section="workflows">${WORKFLOWS_ICON}<span>Workflows</span></a>
|
|
54
49
|
<span class="le-rail-gap"></span>
|
|
@@ -56,14 +51,6 @@ export const consoleSidebarHtml = `<aside class="le-sidebar" aria-label="Console
|
|
|
56
51
|
<div class="le-who" id="leWho" hidden></div>
|
|
57
52
|
</nav>
|
|
58
53
|
<div class="le-panel" hidden>
|
|
59
|
-
<section class="le-pane" data-le-pane="goals">
|
|
60
|
-
<div class="le-pane-head"><a href="/goals">Goals</a><a class="le-pane-new" href="/goals?new=1" data-le-goal-new>+ New</a></div>
|
|
61
|
-
<ul class="le-agent-list le-goal-list" id="leGoalList"></ul>
|
|
62
|
-
</section>
|
|
63
|
-
<section class="le-pane" data-le-pane="jobs">
|
|
64
|
-
<div class="le-pane-head"><a href="/jobs">Jobs</a><a class="le-pane-new" href="/jobs?new=1" data-le-job-new>+ New</a></div>
|
|
65
|
-
<ul class="le-agent-list le-goal-list" id="leJobList"></ul>
|
|
66
|
-
</section>
|
|
67
54
|
<section class="le-pane" data-le-pane="agents">
|
|
68
55
|
<div class="le-pane-head"><a href="/agents">Agents</a><a class="le-pane-new" href="/agents?new=1">+ New</a></div>
|
|
69
56
|
<ul class="le-agent-list" id="leAgentList"></ul>
|
|
@@ -276,11 +263,11 @@ export const consoleShellScript = `<script>
|
|
|
276
263
|
var currentAgent = page === 'agent-config' && q.get('tab') === 'workflows' ? q.get('agent') : null;
|
|
277
264
|
var currentId = currentAgent ? q.get('workflow') : null;
|
|
278
265
|
return cachedFetch('workflows', '/workflows/overview', function (data) {
|
|
279
|
-
var list = (data.workflows || []).slice().sort(function (a, b) { return a.
|
|
266
|
+
var list = (data.workflows || []).slice().sort(function (a, b) { return a.title.localeCompare(b.title); });
|
|
280
267
|
workflowList.innerHTML = list.length ? list.map(function (w) {
|
|
281
268
|
var on = w.agent === currentAgent && w.id === currentId;
|
|
282
269
|
return '<li><a class="le-agent-item le-goal-item" href="/agents/config?agent=' + enc(w.agent) + '&tab=workflows&workflow=' + enc(w.id) + '" title="' + esc(w.title) + ' (' + esc(w.agentLabel) + DOT_SEP + (w.live ? 'Running' : 'Pending') + ')"' + (on ? ' aria-current="page"' : '') + '>' +
|
|
283
|
-
'<span class="le-dot ' + (w.live ? 'tint' : 'pending') + '" aria-hidden="true"></span><span class="le-name
|
|
270
|
+
'<span class="le-dot ' + (w.live ? 'tint' : 'pending') + '" aria-hidden="true"></span><span class="le-name">' + esc(w.title) + '</span></a></li>';
|
|
284
271
|
}).join('') : '<li class="le-agent-item"><span></span><span class="le-meta">No workflows yet</span><span></span></li>';
|
|
285
272
|
});
|
|
286
273
|
}
|
|
@@ -148,7 +148,6 @@ export const devUiCss = `
|
|
|
148
148
|
.le-pane-head a.le-pane-new { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
|
|
149
149
|
.le-pane-head a.le-pane-new[aria-current="page"] { text-decoration: underline; }
|
|
150
150
|
.le-pane .le-agent-list { max-height: none; }
|
|
151
|
-
.le-name.le-slug { font-family: var(--font-mono); font-size: 12.5px; }
|
|
152
151
|
.le-goal-item .le-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
|
|
153
152
|
.le-agent-list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 0 1 auto; max-height: 40vh; min-height: 0; }
|
|
154
153
|
/* Find your first agent: one more item under Agents. */
|
package/dist/web/goals-admin.js
CHANGED
|
@@ -236,6 +236,7 @@ function startPlanning(deps, goal) {
|
|
|
236
236
|
goal: planning.goal,
|
|
237
237
|
context,
|
|
238
238
|
saved: planning.jobs.map((w) => ({ title: w.title, lever: w.lever, ...(w.leverId ? { leverId: w.leverId } : {}), state: w.state })),
|
|
239
|
+
...(planning.setup.length ? { setup: planning.setup } : {}),
|
|
239
240
|
...(planning.focus ? { focus: planning.focus } : {}),
|
|
240
241
|
});
|
|
241
242
|
// A focus or levers the planner wrote, because the playbook had none
|
|
@@ -254,7 +255,7 @@ function startPlanning(deps, goal) {
|
|
|
254
255
|
const updated = {
|
|
255
256
|
...latest,
|
|
256
257
|
brief: plan.brief,
|
|
257
|
-
setup: [...new Set([...latest.setup, ...plan.setup])],
|
|
258
|
+
setup: [...new Set([...latest.setup, ...plan.setup.slice(0, 4)])],
|
|
258
259
|
message: plan.message,
|
|
259
260
|
playbookVersion: plan.playbookVersion,
|
|
260
261
|
status: 'ready',
|
package/dist/web/goals-page.js
CHANGED
|
@@ -131,6 +131,9 @@ const goalsPageTemplate = `<!doctype html>
|
|
|
131
131
|
.gl-again { display: grid; gap: 6px; }
|
|
132
132
|
.gl-again[hidden] { display: none; }
|
|
133
133
|
.gl-setup { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 4px; }
|
|
134
|
+
.gl-setup-more { margin-top: 4px; font-size: 13px; }
|
|
135
|
+
.gl-setup-more summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; }
|
|
136
|
+
.gl-setup-more .gl-setup { margin-top: 4px; }
|
|
134
137
|
.gl-select { font: inherit; font-size: 13px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
|
|
135
138
|
.gl-share { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; line-height: 1.45; }
|
|
136
139
|
.gl-share input { margin-top: 2px; }
|
|
@@ -629,7 +632,8 @@ ${consoleShellScript}
|
|
|
629
632
|
(g.message ? '<p class="gl-why">' + esc(g.message) + '</p>' : '') +
|
|
630
633
|
(planning ? '<p class="gl-status">Suggesting jobs' + ELLIPSIS + (secs ? ' ' + secs + 's' : '') + ' It reads your workspace first; this takes about a minute.</p>' : '') +
|
|
631
634
|
(g.status === 'failed' ? '<p class="error">' + esc(g.error || 'Planning failed.') + '</p>' : '') +
|
|
632
|
-
(g.setup && g.setup.length ? '<div><strong style="font-size:13.5px">Before you start</strong><ol class="gl-setup">' + g.setup.map(function (s) { return '<li>' + esc(s) + '</li>'; }).join('') + '</ol
|
|
635
|
+
(g.setup && g.setup.length ? '<div><strong style="font-size:13.5px">Before you start</strong><ol class="gl-setup">' + g.setup.slice(0, 4).map(function (s) { return '<li>' + esc(s) + '</li>'; }).join('') + '</ol>' +
|
|
636
|
+
(g.setup.length > 4 ? '<details class="gl-setup-more"><summary>' + (g.setup.length - 4) + ' more</summary><ol class="gl-setup" start="5">' + g.setup.slice(4).map(function (s) { return '<li>' + esc(s) + '</li>'; }).join('') + '</ol></details>' : '') + '</div>' : '') +
|
|
633
637
|
'</div>' +
|
|
634
638
|
(state.justDiscarded ? '<div class="gl-discarded-note" data-discarded="' + esc(state.justDiscarded.id) + '"><span>Discarded <strong>' + esc(state.justDiscarded.title) + '</strong>. Why?</span>' +
|
|
635
639
|
REASONS.map(function (r) { return '<button type="button" class="gl-btn plain" data-reason="' + r[0] + '">' + r[1] + '</button>'; }).join('') +
|
package/dist/web/inbox-page.js
CHANGED
|
@@ -38,6 +38,8 @@ export const inboxPageHtml = `<!doctype html>
|
|
|
38
38
|
.ib-empty { padding: 28px 16px; text-align: center; color: var(--ink-muted); font-size: 13.5px; }
|
|
39
39
|
.ib-back { font-size: 13px; color: var(--accent-ink); text-decoration: none; font-weight: 600; }
|
|
40
40
|
.ib-case-head h2 { margin: 4px 0 6px; font-size: 20px; letter-spacing: -0.01em; }
|
|
41
|
+
.ib-link { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
|
|
42
|
+
.ib-link:hover { text-decoration: underline; }
|
|
41
43
|
.ib-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-muted); }
|
|
42
44
|
.ib-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 14px 16px; display: grid; gap: 10px; }
|
|
43
45
|
.ib-card h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); }
|
|
@@ -243,12 +245,21 @@ ${renderMarkdownScript}
|
|
|
243
245
|
}).join('') + '</div></div>';
|
|
244
246
|
}
|
|
245
247
|
|
|
248
|
+
// The case's workflow and agent, each opening its page. An approver or
|
|
249
|
+
// viewer can open only the Inbox, so for them they're plain text.
|
|
250
|
+
function caseLinks(c) {
|
|
251
|
+
if (document.querySelector('.le-app.le-inbox-only')) return esc(c.workflowTitle) + DOT + esc(c.agent);
|
|
252
|
+
var agentUrl = '/agents/config?agent=' + encodeURIComponent(c.agent);
|
|
253
|
+
var wf = c.workflowId ? '<a class="ib-link" href="' + agentUrl + '&tab=workflows&workflow=' + encodeURIComponent(c.workflowId) + '">' + esc(c.workflowTitle) + '</a>' : esc(c.workflowTitle);
|
|
254
|
+
return wf + DOT + '<a class="ib-link" href="' + agentUrl + '">' + esc(c.agent) + '</a>';
|
|
255
|
+
}
|
|
256
|
+
|
|
246
257
|
function renderCase(c) {
|
|
247
258
|
var run = c.run;
|
|
248
259
|
var status = run ? stateHtml({ waiting: c.pending.map(function (p) { return p.kind; }), status: run.status }) : stateHtml({ waiting: c.pending.map(function (p) { return p.kind; }), status: 'awaiting_approval' });
|
|
249
260
|
page.innerHTML =
|
|
250
261
|
'<a class="ib-back" href="' + pageUrl() + '">' + String.fromCharCode(8592) + ' Inbox</a>' +
|
|
251
|
-
'<div class="ib-case-head"><h2>' + esc(c.title) + '</h2><div class="ib-chips">' + status + '<span>' +
|
|
262
|
+
'<div class="ib-case-head"><h2>' + esc(c.title) + '</h2><div class="ib-chips">' + status + '<span>' + caseLinks(c) + (run ? DOT + 'started ' + esc(when(run.started_at)) + (run.source ? ' by ' + esc(run.source === 'webhook' ? 'a webhook' : run.source === 'schedule' ? 'a schedule' : run.source === 'console' ? 'Run now' : run.source === 'api' ? 'an app' : run.source) : '') : '') + '</span></div></div>' +
|
|
252
263
|
c.pending.map(pendingHtml).join('') +
|
|
253
264
|
(run && run.params ? '<div class="ib-card"><h3>Inputs</h3>' + kvHtml(run.params) + '</div>' : '') +
|
|
254
265
|
(c.steps.length ? '<div class="ib-card"><h3>What the agent did</h3><ol class="ib-steps">' + c.steps.map(stepHtml).join('') + '</ol></div>' : '') +
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// The console's front page: / and /workflows list every workflow in the
|
|
2
2
|
// workspace with how it starts, how it's been running and what's waiting
|
|
3
3
|
// in the Inbox (web/workflows-overview.ts behind /workflows/overview).
|
|
4
|
-
// Goals and Jobs are the way in when there's nothing to automate yet.
|
|
5
4
|
// Like the other console pages, its inline script avoids backslashes and
|
|
6
5
|
// template placeholders, since it lives inside a template literal.
|
|
7
6
|
import { devUiCss } from './dev-ui-styles.js';
|
|
@@ -28,7 +27,6 @@ export const workflowsOverviewPageHtml = `<!doctype html>
|
|
|
28
27
|
.wo-head { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface); }
|
|
29
28
|
.wo-head:hover { background: var(--surface); }
|
|
30
29
|
.wo-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
31
|
-
.wo-slug { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
|
|
32
30
|
.wo-sub { font-size: 12.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
33
31
|
.wo-runs { font-size: 13px; display: grid; gap: 2px; }
|
|
34
32
|
.wo-side { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
|
|
@@ -45,8 +43,6 @@ export const workflowsOverviewPageHtml = `<!doctype html>
|
|
|
45
43
|
.wo-way:hover { border-color: var(--accent); }
|
|
46
44
|
.wo-way b { font-size: 14px; }
|
|
47
45
|
.wo-way span { font-size: 12.5px; color: var(--ink-muted); }
|
|
48
|
-
.wo-plan { border-radius: 12px; background: var(--surface); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; font-size: 13.5px; }
|
|
49
|
-
.wo-plan a { font-weight: 600; color: var(--accent-ink); text-decoration: none; }
|
|
50
46
|
.hint { font-size: 12.5px; color: var(--ink-muted); }
|
|
51
47
|
.error { font-size: 13px; color: var(--bad); margin: 0; }
|
|
52
48
|
@media (max-width: 760px) { .wo-row { grid-template-columns: minmax(0, 1fr) auto; } .wo-row .wo-col-starts, .wo-row .wo-col-runs { display: none; } .wo-head { display: none; } }
|
|
@@ -95,8 +91,6 @@ ${consoleShellScript}
|
|
|
95
91
|
}
|
|
96
92
|
function plural(n, one, many) { return n + ' ' + (n === 1 ? one : many); }
|
|
97
93
|
|
|
98
|
-
var PLAN = '<div class="wo-plan"><span>Not sure what to automate next? Say what you want to achieve, and LoopEngine suggests the jobs that move it.</span><a href="/goals?new=1">Start from a goal →</a></div>';
|
|
99
|
-
|
|
100
94
|
function renderEmpty() {
|
|
101
95
|
page.innerHTML =
|
|
102
96
|
'<div class="wo-empty"><h2>No workflows yet</h2>' +
|
|
@@ -104,7 +98,6 @@ ${consoleShellScript}
|
|
|
104
98
|
'<div class="wo-ways">' +
|
|
105
99
|
'<a class="wo-way" href="/workflows/new"><b>Describe a workflow</b><span>Say what the agent should do in a sentence or two and review the plan.</span></a>' +
|
|
106
100
|
'<a class="wo-way" href="/workflows/new#examples"><b>Start from an example</b><span>A ready-made workflow for a common task.</span></a>' +
|
|
107
|
-
'<a class="wo-way" href="/goals?new=1"><b>Start from a goal</b><span>Not sure what to automate? Get jobs suggested for what you want to achieve.</span></a>' +
|
|
108
101
|
'</div></div>';
|
|
109
102
|
}
|
|
110
103
|
|
|
@@ -121,7 +114,7 @@ ${consoleShellScript}
|
|
|
121
114
|
var rows = d.workflows.map(function (w) {
|
|
122
115
|
var decided = w.approved + w.refused;
|
|
123
116
|
return '<a class="wo-row" href="' + href(w) + '">' +
|
|
124
|
-
'<span style="min-width:0"><div class="wo-title
|
|
117
|
+
'<span style="min-width:0"><div class="wo-title">' + esc(w.title) + '</div><div class="wo-sub">' + esc(w.agentLabel) + '</div></span>' +
|
|
125
118
|
'<span class="wo-col-starts wo-sub" title="' + esc(w.starts.join(', ')) + '">' + esc(w.starts.join(DOT)) + '</span>' +
|
|
126
119
|
'<span class="wo-col-runs wo-runs"><span>' + plural(w.runsThisWeek, 'run', 'runs') + ' this week' + (w.failedThisWeek ? ', <span style="color:var(--bad)">' + w.failedThisWeek + ' failed</span>' : '') + '</span>' +
|
|
127
120
|
'<span class="wo-sub">' + (w.lastRun ? 'Last ' + esc(ago(w.lastRun.at)) : 'Not run yet') + (decided ? DOT + w.approved + ' of ' + decided + ' approved' : '') + '</span></span>' +
|
|
@@ -129,8 +122,7 @@ ${consoleShellScript}
|
|
|
129
122
|
'</a>';
|
|
130
123
|
}).join('');
|
|
131
124
|
page.innerHTML = stats +
|
|
132
|
-
'<div class="wo-list"><div class="wo-row wo-head"><span>Workflow</span><span class="wo-col-starts">Starts</span><span class="wo-col-runs">Runs</span><span></span></div>' + rows + '</div>'
|
|
133
|
-
PLAN;
|
|
125
|
+
'<div class="wo-list"><div class="wo-row wo-head"><span>Workflow</span><span class="wo-col-starts">Starts</span><span class="wo-col-runs">Runs</span><span></span></div>' + rows + '</div>';
|
|
134
126
|
}
|
|
135
127
|
|
|
136
128
|
// The sidebar asks for the same list as the page opens: one request.
|