ucode-agent 1.31.0 → 1.32.0
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/package.json +1 -1
- package/src/core/loop.js +43 -6
package/package.json
CHANGED
package/src/core/loop.js
CHANGED
|
@@ -556,6 +556,34 @@ function systemPrompt({ cwd, skills, mode, check, map, memory }) {
|
|
|
556
556
|
'already contains it. Do not re-check work the checks have already reported on.',
|
|
557
557
|
'Fast is not sloppy: it is the same work with the waiting taken out.',
|
|
558
558
|
'',
|
|
559
|
+
'DESIGN IT BEFORE YOU TYPE IT. Fast means fewer round trips. It does not mean a',
|
|
560
|
+
'default theme, and an app that goes out in the palette its starter came with is',
|
|
561
|
+
'not a fast build, it is an undesigned one. There is no design pass after the',
|
|
562
|
+
'create_app call, because there is no after — so the decisions happen before it.',
|
|
563
|
+
'',
|
|
564
|
+
'Three of them, and you hold them for the whole build:',
|
|
565
|
+
' - A TONE, one word you commit to: clinical, warm, editorial, technical,',
|
|
566
|
+
' playful, industrial, calm, dense. "Modern and clean" is not a tone.',
|
|
567
|
+
' - An ACCENT that is not the one the starter shipped with.',
|
|
568
|
+
' - ONE memorable thing this app has that other apps do not: a colour, a type',
|
|
569
|
+
' move, a texture, one interaction. Exactly one. It is the difference between',
|
|
570
|
+
' a design and a theme.',
|
|
571
|
+
'Name the tone and the accent in your opening line, so they are settled before any',
|
|
572
|
+
'file exists: "I will build Tide - a tasks app in one HTML file, calm, warm grey',
|
|
573
|
+
'with a single amber accent." That is not narrating a plan, that is the decision.',
|
|
574
|
+
'',
|
|
575
|
+
'Then the tokens are the first thing in the file, in the same call as everything',
|
|
576
|
+
'else: the type scale, the space scale, neutrals that carry a hue, the accent and',
|
|
577
|
+
'its semantics. Nothing after that uses a raw value. IN next-shadcn THAT MEANS',
|
|
578
|
+
'globals.css IS RE-TINTED IN THAT SAME create_app CALL. Shipping the palette the',
|
|
579
|
+
'starter came with is the commonest way a build looks generated, and it is the',
|
|
580
|
+
'first thing anyone notices. A blocked-out page in the colours this app chose',
|
|
581
|
+
'beats a finished page in the ones it was handed.',
|
|
582
|
+
'',
|
|
583
|
+
'add_block gives you structure, never a look. A block arrives with no opinion',
|
|
584
|
+
'about this app and is yours to tint the moment it lands. Assembling blocks and',
|
|
585
|
+
'shipping them as they came is the quick way to something nobody designed.',
|
|
586
|
+
'',
|
|
559
587
|
'Never repeat the request back. Not as a summary, not as a restatement, not as',
|
|
560
588
|
'a list of what was asked for. They wrote it and it is on the screen above you.',
|
|
561
589
|
'Do not narrate your planning either - which files you will make, what order you',
|
|
@@ -665,6 +693,11 @@ function systemPrompt({ cwd, skills, mode, check, map, memory }) {
|
|
|
665
693
|
' reports - errors, layout that overflows a phone, the review points worth fixing -',
|
|
666
694
|
' in one pass, then look once more. A clean second look means it is done: report',
|
|
667
695
|
' back instead of polishing in circles. Never call an interface finished unlooked at.',
|
|
696
|
+
'- ANYTHING THAT NEEDS A SERVER IS LEFT RUNNING. If the app has a dev server -',
|
|
697
|
+
' Next.js, Vite, anything with an npm run dev - start it and leave it up when you',
|
|
698
|
+
' finish. ucode opens it in the browser for the user as soon as it is ready, so a',
|
|
699
|
+
' build that ends with the server stopped ends with nothing to look at. A one-page',
|
|
700
|
+
' app with no server needs none of this: the file is the app.',
|
|
668
701
|
' name, handles keys and returns the live link. Build locally first.',
|
|
669
702
|
'- Nothing you run has a keyboard. Pass the non-interactive flag to anything that',
|
|
670
703
|
' would ask a question, or it fails instead of waiting: create-next-app --yes,',
|
|
@@ -1540,15 +1573,19 @@ export class Agent {
|
|
|
1540
1573
|
|
|
1541
1574
|
/** A dev server came up during this turn: open it in the browser, once. */
|
|
1542
1575
|
/**
|
|
1543
|
-
* Open the running app in a browser
|
|
1576
|
+
* Open the running app in a browser as soon as a dev server is up.
|
|
1577
|
+
*
|
|
1578
|
+
* This was turned off once, on the grounds that a window seizing the screen
|
|
1579
|
+
* mid-thought is startling and worse during a demo. It only fires at the end
|
|
1580
|
+
* of a finished turn, though, not mid-thought — and the thing the user asked
|
|
1581
|
+
* for is a running app, not a URL they then have to go and click. Being
|
|
1582
|
+
* handed a link to the thing you asked to be built is the last step of the
|
|
1583
|
+
* job left undone.
|
|
1544
1584
|
*
|
|
1545
|
-
*
|
|
1546
|
-
* seizing the screen mid-thought is startling at the best of times, and
|
|
1547
|
-
* during a demo it is worse. UCODE_OPEN=1 brings the old behaviour back for
|
|
1548
|
-
* anyone who liked it; otherwise the URL is on screen to click.
|
|
1585
|
+
* UCODE_OPEN=0 turns it off for anyone who wants the link and nothing else.
|
|
1549
1586
|
*/
|
|
1550
1587
|
openWhenReady(since) {
|
|
1551
|
-
if (!this.full || process.env.UCODE_OPEN
|
|
1588
|
+
if (!this.full || process.env.UCODE_OPEN === '0') return;
|
|
1552
1589
|
const server = serversReadySince(since).at(-1);
|
|
1553
1590
|
if (!server || (this.opened ??= new Set()).has(server.url)) return;
|
|
1554
1591
|
this.opened.add(server.url);
|