makersclaw 0.1.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 +68 -0
- package/bin/makersclaw.mjs +10 -0
- package/package.json +34 -0
- package/registry/blocks/board/README.md +130 -0
- package/registry/blocks/board/block.json +10 -0
- package/registry/blocks/board/board.jsx +435 -0
- package/registry/blocks/board/demo.jsx +50 -0
- package/registry/blocks/board/index.js +4 -0
- package/registry/blocks/job-panel/README.md +68 -0
- package/registry/blocks/job-panel/block.json +10 -0
- package/registry/blocks/job-panel/demo.jsx +75 -0
- package/registry/blocks/job-panel/index.js +3 -0
- package/registry/blocks/job-panel/job-panel.jsx +110 -0
- package/src/cli.mjs +301 -0
- package/src/fsutil.mjs +76 -0
- package/src/install.mjs +457 -0
- package/src/registry.mjs +191 -0
- package/templates/next/files/README.md +626 -0
- package/templates/next/files/app/auto-refresh.jsx +26 -0
- package/templates/next/files/app/error-relay.jsx +53 -0
- package/templates/next/files/app/error.jsx +44 -0
- package/templates/next/files/app/global-error.jsx +36 -0
- package/templates/next/files/app/globals.css +178 -0
- package/templates/next/files/app/layout.jsx +51 -0
- package/templates/next/files/app/not-found.jsx +23 -0
- package/templates/next/files/app/page.jsx +22 -0
- package/templates/next/files/app/s/[key]/page.jsx +47 -0
- package/templates/next/files/app/shell.jsx +64 -0
- package/templates/next/files/check/run.mjs +683 -0
- package/templates/next/files/components/parts/fixture.jsx +60 -0
- package/templates/next/files/components/parts/index.js +5 -0
- package/templates/next/files/components/parts/record-switcher.jsx +49 -0
- package/templates/next/files/components/ui/button.jsx +81 -0
- package/templates/next/files/components/ui/cx.js +4 -0
- package/templates/next/files/components/ui/depiction.jsx +66 -0
- package/templates/next/files/components/ui/field.jsx +126 -0
- package/templates/next/files/components/ui/icon.jsx +87 -0
- package/templates/next/files/components/ui/index.js +12 -0
- package/templates/next/files/components/ui/menu.jsx +123 -0
- package/templates/next/files/components/ui/notice.jsx +86 -0
- package/templates/next/files/components/ui/sheet.jsx +89 -0
- package/templates/next/files/components/ui/tabs.jsx +81 -0
- package/templates/next/files/lib/actions.js +187 -0
- package/templates/next/files/lib/claw.js +219 -0
- package/templates/next/files/lib/data.js +171 -0
- package/templates/next/files/lib/db.js +72 -0
- package/templates/next/files/lib/hooks.js +218 -0
- package/templates/next/files/lib/platform.js +59 -0
- package/templates/next/files/lib/sample.js +12 -0
- package/templates/next/files/middleware.js +42 -0
- package/templates/next/files/next.config.mjs +41 -0
- package/templates/next/files/package.json +19 -0
- package/templates/next/files/postcss.config.mjs +3 -0
- package/templates/next/files/schema.sql +22 -0
- package/templates/next/files/surfaces/README.md +32 -0
- package/templates/next/files/surfaces.js +53 -0
- package/templates/next/template.json +118 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# surfaces/
|
|
2
|
+
|
|
3
|
+
One file per domain surface, named after its key: `surfaces/<key>.jsx`.
|
|
4
|
+
Each default-exports a component. It receives `surface` (`{ key, kind,
|
|
5
|
+
label, source }`) and `searchParams` (the URL query; `?row=<id>` means
|
|
6
|
+
"highlight this row").
|
|
7
|
+
|
|
8
|
+
A server surface reads with `../lib/data` and renders; a surface that
|
|
9
|
+
needs hooks or handlers starts with `"use client"`, uses `../lib/hooks`
|
|
10
|
+
and `../lib/actions`, and cannot import `../lib/data` — split it into a
|
|
11
|
+
server file that loads rows and a client component that gets them as
|
|
12
|
+
props (see `../README.md` §4).
|
|
13
|
+
|
|
14
|
+
Agent, Runs and Activity are not surfaces. The OS draws them as tabs on
|
|
15
|
+
the app window, beside the App tab these files fill; their keys
|
|
16
|
+
(`agent`, `runs`, `activity`) are reserved and no file here may take
|
|
17
|
+
one. Settings (model, prompt, skills, connections, schedule) are not a
|
|
18
|
+
surface either: they are the window's Settings tab, the same for every
|
|
19
|
+
artifact.
|
|
20
|
+
|
|
21
|
+
Commissioning work IS a surface's business. A surface that lists objects
|
|
22
|
+
the agent can produce carries the verb that starts one ("Generate a
|
|
23
|
+
launch plan", beside the manual "New launch plan") and draws the panel
|
|
24
|
+
that follows it — `useJob()` in `../lib/hooks.js`, §5 of `../README.md`.
|
|
25
|
+
The panel is not a surface and takes no key: it opens because the founder
|
|
26
|
+
pressed something and closes when the work lands.
|
|
27
|
+
|
|
28
|
+
Register each in `../surfaces.js` (import + entry with `component`).
|
|
29
|
+
Until the entry has a `component` the surface is planned: marked in the
|
|
30
|
+
nav, "Makersclaw is building this" on its page.
|
|
31
|
+
|
|
32
|
+
The API is in `../README.md` §5.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The surface manifest — the one file that says what this app shows.
|
|
3
|
+
* The shell's nav lists these in order; /s/<key> renders the matching
|
|
4
|
+
* component; the desk checklist reads the same list.
|
|
5
|
+
*
|
|
6
|
+
* key the route segment and the `surface` stamped on activity rows
|
|
7
|
+
* label what the nav shows
|
|
8
|
+
* kind optional, free text, one or two words for the checklist
|
|
9
|
+
* ("board", "inbox", "report") — not an enum, nothing keys on it
|
|
10
|
+
* source the table the surface reads, when it reads one
|
|
11
|
+
* home true on the one surface / opens; otherwise the first entry
|
|
12
|
+
* component the surface's component. LEAVE IT OUT while the surface is
|
|
13
|
+
* still planned: the nav shows it as planned and its page says
|
|
14
|
+
* "Makersclaw is building this". Add the file under surfaces/,
|
|
15
|
+
* import it here, set `component`, and it is built.
|
|
16
|
+
*
|
|
17
|
+
* Only DOMAIN surfaces live here — the things the app finds, makes, sends
|
|
18
|
+
* or receives. Agent, Runs and Activity are not surfaces: the OS draws
|
|
19
|
+
* them as tabs on every app window, beside the App tab this manifest
|
|
20
|
+
* fills. Their keys (`agent`, `runs`, `activity`) are reserved and an
|
|
21
|
+
* entry may not take one. The template ships this list empty;
|
|
22
|
+
* Makersclaw writes this file from the blueprint (artifact_scaffold).
|
|
23
|
+
* Import it from server code only (pages, layout): entries with a
|
|
24
|
+
* component pull in server components.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
// A domain surface, once built, looks like this:
|
|
28
|
+
//
|
|
29
|
+
// import Investors from "./surfaces/investors";
|
|
30
|
+
// { key: "investors", label: "Investors", kind: "board", source: "public.investors", home: true, component: Investors },
|
|
31
|
+
|
|
32
|
+
const surfaces = [];
|
|
33
|
+
|
|
34
|
+
export default surfaces;
|
|
35
|
+
|
|
36
|
+
/** The surface / opens: the one flagged `home`, else the first entry;
|
|
37
|
+
* undefined while the manifest is empty (app/page.jsx says so). */
|
|
38
|
+
export function homeSurface() {
|
|
39
|
+
return surfaces.find((s) => s.home) ?? surfaces[0];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The nav's view of the manifest: plain data, no components, so it can
|
|
43
|
+
* cross into client components (app/shell.jsx). */
|
|
44
|
+
export function surfaceNav() {
|
|
45
|
+
return surfaces.map(({ key, label, kind, source, home, component }) => ({
|
|
46
|
+
key,
|
|
47
|
+
label,
|
|
48
|
+
kind: kind ?? null,
|
|
49
|
+
source: source ?? null,
|
|
50
|
+
home: Boolean(home),
|
|
51
|
+
built: Boolean(component),
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "next",
|
|
3
|
+
"title": "Makersclaw app (Next.js 15)",
|
|
4
|
+
"description": "The behaviour every app shares, the parts every app is assembled from, and none of the app's own look — the colours are the workspace's. It carries the data layer (lib/data.js, lib/db.js), the write actions that log activity (lib/actions.js), the _claw platform client with its identity wrapper and hooks (lib/claw.js, lib/platform.js, lib/hooks.js), routing (/s/<key>), the middleware, error boundaries, Tailwind v4 mapped to the workspace theme (app/globals.css + _claw/theme.css), the kit (components/ui), the parts bound to the data layer (components/parts) and `npm run check`. The app designs the inside of the App tab on top: app/shell.jsx and every domain surface, assembled from the kit and the blocks with tokens only.",
|
|
5
|
+
"files": {
|
|
6
|
+
"fixed": [
|
|
7
|
+
"app/globals.css",
|
|
8
|
+
"app/layout.jsx",
|
|
9
|
+
"app/page.jsx",
|
|
10
|
+
"app/error.jsx",
|
|
11
|
+
"app/global-error.jsx",
|
|
12
|
+
"app/not-found.jsx",
|
|
13
|
+
"app/error-relay.jsx",
|
|
14
|
+
"app/auto-refresh.jsx",
|
|
15
|
+
"app/s/[key]/page.jsx",
|
|
16
|
+
"lib/*.js",
|
|
17
|
+
"components/ui/*",
|
|
18
|
+
"components/parts/*",
|
|
19
|
+
"check/run.mjs",
|
|
20
|
+
"middleware.js",
|
|
21
|
+
"next.config.mjs",
|
|
22
|
+
"postcss.config.mjs"
|
|
23
|
+
],
|
|
24
|
+
"docs": ["README.md", "surfaces/README.md", "schema.sql"],
|
|
25
|
+
"starter": ["app/shell.jsx", "surfaces.js"],
|
|
26
|
+
"merged": ["package.json"]
|
|
27
|
+
},
|
|
28
|
+
"components": [
|
|
29
|
+
{
|
|
30
|
+
"name": "button",
|
|
31
|
+
"type": "component",
|
|
32
|
+
"title": "Button, IconButton",
|
|
33
|
+
"description": "The one button: variant primary (one per surface) · secondary · quiet · danger · link; size md (44px) · sm; icon; href for a link. IconButton for an icon alone, label required.",
|
|
34
|
+
"tags": ["button", "action", "link", "icon button"],
|
|
35
|
+
"files": ["components/ui/button.jsx"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "field",
|
|
39
|
+
"type": "component",
|
|
40
|
+
"title": "Field, Input, Textarea, Select, Switch, Checkbox",
|
|
41
|
+
"description": "Form controls with their label, hint and error. Select with empty options renders a muted line, never a disabled dropdown.",
|
|
42
|
+
"tags": ["form", "input", "select", "dropdown", "textarea", "switch", "checkbox", "toggle"],
|
|
43
|
+
"files": ["components/ui/field.jsx"]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "notice",
|
|
47
|
+
"type": "component",
|
|
48
|
+
"title": "Card, Notice, Badge, Kicker, Empty",
|
|
49
|
+
"description": "Containers and signals: Card, Notice (tone neutral · info · success · warning · danger), Badge, Kicker (the small line above a heading), Empty (a search or filter with no matches).",
|
|
50
|
+
"tags": ["card", "alert", "notice", "badge", "empty state", "status"],
|
|
51
|
+
"files": ["components/ui/notice.jsx"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "sheet",
|
|
55
|
+
"type": "component",
|
|
56
|
+
"title": "Sheet, Confirm",
|
|
57
|
+
"description": "The one overlay — a rail beside the work (side end), a dialog (center) or a bottom sheet; every side is a bottom sheet on a narrow window. Confirm is the \"delete this?\" case.",
|
|
58
|
+
"tags": ["dialog", "modal", "drawer", "overlay", "confirm", "rail"],
|
|
59
|
+
"files": ["components/ui/sheet.jsx"]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "tabs",
|
|
63
|
+
"type": "component",
|
|
64
|
+
"title": "Tabs, TabPanel",
|
|
65
|
+
"description": "Views of ONE thing (a record's notes | history), with roving focus. Never for the app's surfaces — those are the shell's nav.",
|
|
66
|
+
"tags": ["tabs", "views", "segmented"],
|
|
67
|
+
"files": ["components/ui/tabs.jsx"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "menu",
|
|
71
|
+
"type": "component",
|
|
72
|
+
"title": "Menu",
|
|
73
|
+
"description": "The \"…\" of a row, on the Popover API. Empty items render nothing: a menu is earned by having actions.",
|
|
74
|
+
"tags": ["menu", "dropdown", "actions", "overflow"],
|
|
75
|
+
"files": ["components/ui/menu.jsx"]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "icon",
|
|
79
|
+
"type": "component",
|
|
80
|
+
"title": "Icon",
|
|
81
|
+
"description": "One inline sprite of stroke glyphs; ICON_NAMES lists them. A missing glyph is added here, never drawn as an <svg> in a surface.",
|
|
82
|
+
"tags": ["icon", "glyph", "svg"],
|
|
83
|
+
"files": ["components/ui/icon.jsx"]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "depiction",
|
|
87
|
+
"type": "component",
|
|
88
|
+
"title": "Depiction",
|
|
89
|
+
"description": "The frame for a picture of something that exists elsewhere (a tweet, a LinkedIn post) — scales it to the column without reflowing it. README §3c.",
|
|
90
|
+
"tags": ["depiction", "preview", "mockup", "frame"],
|
|
91
|
+
"files": ["components/ui/depiction.jsx"]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "cx",
|
|
95
|
+
"type": "component",
|
|
96
|
+
"title": "cx",
|
|
97
|
+
"description": "Join class names, dropping the falsy ones.",
|
|
98
|
+
"tags": ["classnames", "utility"],
|
|
99
|
+
"files": ["components/ui/cx.js"]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "fixture",
|
|
103
|
+
"type": "part",
|
|
104
|
+
"title": "useFixture, isSample, FixtureNotice",
|
|
105
|
+
"description": "The worked example shown while a table is empty — rows in code, never INSERTed; clearing writes nothing; a sample row carries _sample.",
|
|
106
|
+
"tags": ["example", "sample", "fixture", "empty state", "onboarding"],
|
|
107
|
+
"files": ["components/parts/fixture.jsx"]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "record-switcher",
|
|
111
|
+
"type": "part",
|
|
112
|
+
"title": "RecordSwitcher",
|
|
113
|
+
"description": "Pick a saved record or make a new one; with nothing saved it shows only New.",
|
|
114
|
+
"tags": ["switcher", "picker", "saved", "records", "select"],
|
|
115
|
+
"files": ["components/parts/record-switcher.jsx"]
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|