ucode-agent 1.44.0 → 1.47.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/README.md +6 -5
- package/package.json +5 -3
- package/src/core/csscheck.js +77 -0
- package/src/core/history.js +6 -1
- package/src/core/jslogic.js +69 -0
- package/src/core/loop.js +3005 -2821
- package/src/core/provider.js +931 -924
- package/src/core/relink.js +2 -1
- package/src/tools/blocks.js +2 -2
- package/src/tools/browser.js +546 -496
- package/src/tools/files.js +750 -743
- package/src/tools/index.js +13 -10
- package/src/tools/rename.js +2 -2
- package/src/tools/scaffold.js +439 -424
- package/src/tools/shared.js +126 -0
- package/src/tools/shell.js +844 -818
- package/src/ui/plain.js +353 -353
- package/src/ui/screen.js +1699 -1692
- package/src/ui/theme.js +814 -776
- package/ucode.js +1 -1
package/src/tools/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import { createApp, TEMPLATE_NAMES, TEMPLATE_NOTES } from './scaffold.js';
|
|
|
16
16
|
import { deploy } from './deploy.js';
|
|
17
17
|
import { clip, READ_LINES } from './shared.js';
|
|
18
18
|
|
|
19
|
-
export { setRoot, setConfirm, getRoot } from './shared.js';
|
|
19
|
+
export { setRoot, setConfirm, setRequest, getRoot } from './shared.js';
|
|
20
20
|
|
|
21
21
|
const str = (description) => ({ type: 'string', description });
|
|
22
22
|
const int = (description) => ({ type: 'integer', description });
|
|
@@ -85,20 +85,20 @@ export const tools = [
|
|
|
85
85
|
'Start a new app AND write it, in one call. Pass "files" with the whole app and this ' +
|
|
86
86
|
'is the only call the build needs: the starter lands, your files are written over it, ' +
|
|
87
87
|
'and the result comes back with everything. Two starters. "plain-html" (the default): ' +
|
|
88
|
-
'one index.html, one stylesheet, one ES module — nothing to install, nothing to build, ' +
|
|
89
|
-
'and the stylesheet is a design system already: a palette, a spacing scale, radii, ' +
|
|
90
|
-
'motion timings, focus rings and a breakpoint. Re-tint those tokens to suit the app ' +
|
|
91
|
-
'and compose every rule from them. Replacing it with raw pixel values is what an ' +
|
|
88
|
+
'one index.html, one stylesheet, one ES module — nothing to install, nothing to build, ' +
|
|
89
|
+
'and the stylesheet is a design system already: a palette, a spacing scale, radii, ' +
|
|
90
|
+
'motion timings, focus rings and a breakpoint. Re-tint those tokens to suit the app ' +
|
|
91
|
+
'and compose every rule from them. Replacing it with raw pixel values is what an ' +
|
|
92
92
|
'undesigned page is made of. ' +
|
|
93
93
|
'opens straight in a browser, and its three files come back inside this result so there ' +
|
|
94
94
|
'is never a reason to read them. Use it for anything that is one page: a tasks app, a ' +
|
|
95
95
|
'toy, a game, a visualisation, a calculator, a timer. "next-shadcn": Next.js 16, ' +
|
|
96
96
|
'TypeScript, Tailwind 4 and shadcn with 33 components — only when the app genuinely ' +
|
|
97
97
|
'needs routes, a database or many screens, because it costs an install and a build. ' +
|
|
98
|
-
'This is how every Next.js app begins - never run create-next-app or shadcn init. ' +
|
|
99
|
-
'In "next-shadcn" every path in "files" goes under src/: a page is a route only at ' +
|
|
100
|
-
'<app>/src/app/page.tsx or <app>/src/app/<segment>/page.tsx, an API handler only at ' +
|
|
101
|
-
'<app>/src/app/api/<name>/route.ts, and components at <app>/src/components/<feature>/. ' +
|
|
98
|
+
'This is how every Next.js app begins - never run create-next-app or shadcn init. ' +
|
|
99
|
+
'In "next-shadcn" every path in "files" goes under src/: a page is a route only at ' +
|
|
100
|
+
'<app>/src/app/page.tsx or <app>/src/app/<segment>/page.tsx, an API handler only at ' +
|
|
101
|
+
'<app>/src/app/api/<name>/route.ts, and components at <app>/src/components/<feature>/. ' +
|
|
102
102
|
'A page.tsx written anywhere else is an ordinary file the router never serves.',
|
|
103
103
|
parameters: {
|
|
104
104
|
type: 'object',
|
|
@@ -124,7 +124,10 @@ export const tools = [
|
|
|
124
124
|
},
|
|
125
125
|
template: {
|
|
126
126
|
type: 'string',
|
|
127
|
-
|
|
127
|
+
// The default goes first: a model picking from an enum reaches for
|
|
128
|
+
// the head of the list, and the head of this one used to be the
|
|
129
|
+
// starter that costs an install and a build.
|
|
130
|
+
enum: ['plain-html', 'next-shadcn'],
|
|
128
131
|
description:
|
|
129
132
|
'Which starter. "plain-html" (the default) for one page, a toy, a game, or any ' +
|
|
130
133
|
'app that does not need a server: no install, no build, nothing to wait for. ' +
|
package/src/tools/rename.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { promises as fs } from 'node:fs';
|
|
19
19
|
import path from 'node:path';
|
|
20
20
|
import { ToolFailure } from '../core/failure.js';
|
|
21
|
-
import { resolveIn, guard, result, walk } from './shared.js';
|
|
21
|
+
import { resolveIn, guard, result, walk, writeTracked } from './shared.js';
|
|
22
22
|
|
|
23
23
|
const SOURCE = /\.(?:[cm]?[jt]sx?|py)$/i;
|
|
24
24
|
const IDENT = /^[A-Za-z_$][\w$]*$/;
|
|
@@ -133,7 +133,7 @@ export async function renameSymbol({ name, to, path: p = '.' }) {
|
|
|
133
133
|
if (before === null || !before.includes(from)) continue;
|
|
134
134
|
const { text, lines } = renameIn(before, from, into);
|
|
135
135
|
if (!lines.length || text === before) continue;
|
|
136
|
-
await
|
|
136
|
+
await writeTracked(abs, text);
|
|
137
137
|
changed.push({ rel: rel || target.show, lines });
|
|
138
138
|
total += lines.length;
|
|
139
139
|
}
|