@40rty/ams-cli 0.2.1 → 0.3.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/bin/commands/connect.mjs +67 -13
- package/bin/commands/deploy.mjs +15 -9
- package/bin/commands/doctor.mjs +110 -29
- package/bin/commands/hosting.mjs +14 -0
- package/bin/commands/init.mjs +12 -8
- package/bin/commands/publish.mjs +12 -3
- package/bin/forty.mjs +3 -1
- package/bin/lib/__tests__/app-kind.test.mjs +48 -0
- package/bin/lib/__tests__/ask.test.mjs +52 -0
- package/bin/lib/ask.mjs +111 -0
- package/bin/lib/base-path-build.mjs +149 -0
- package/bin/lib/build.mjs +20 -8
- package/bin/lib/context.mjs +42 -3
- package/bin/lib/deploy-target.mjs +5 -3
- package/bin/lib/hosted-build.mjs +13 -7
- package/dist/wire.js +104 -0
- package/package.json +1 -1
- package/templates/package/package.json +2 -1
- package/templates/package/src/shell.tsx +15 -62
- package/templates/package/src/styles.css +7 -0
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
useCart,
|
|
5
|
-
useComposerChipSelect,
|
|
6
|
-
useComposerDraft,
|
|
7
|
-
useFourtySession,
|
|
8
|
-
useGoHome,
|
|
9
|
-
useThreadRows,
|
|
10
|
-
} from '@40rty/ams-sdk';
|
|
1
|
+
import {SpacefrontCanvas, useCart, useGoHome} from '@40rty/ams-sdk';
|
|
2
|
+
import {SpacefrontIsland} from '@40rty/ams-ui/island';
|
|
3
|
+
import '@40rty/ams-ui/island.css';
|
|
11
4
|
|
|
12
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The page: a header, the canvas the agent composes onto, and the AMS island —
|
|
7
|
+
* the floating composer every 40rty spacefront is recognised by. The island is
|
|
8
|
+
* `@40rty/ams-ui`'s: its shape is fixed (grip, latest answer, field, round send
|
|
9
|
+
* stamp, suggestion chips, a pill when folded); its look is the brand tokens,
|
|
10
|
+
* mapped onto its `--fourty-island-*` properties in `styles.css`.
|
|
11
|
+
*/
|
|
13
12
|
export function Shell() {
|
|
14
|
-
const session = useFourtySession();
|
|
15
|
-
const [draft, setDraft] = useComposerDraft();
|
|
16
|
-
const {rows, isEmpty} = useThreadRows();
|
|
17
|
-
const selectChip = useComposerChipSelect();
|
|
18
13
|
const goHome = useGoHome();
|
|
19
14
|
const {cart} = useCart();
|
|
20
|
-
const chips = session.suggestions ? session.suggestions.actions : [];
|
|
21
15
|
|
|
22
16
|
return (
|
|
23
|
-
<div className="
|
|
17
|
+
<div className="min-h-screen bg-paper text-ink antialiased">
|
|
24
18
|
<header className="sticky top-0 z-40 flex h-16 items-center justify-between border-b border-ink/10 bg-paper/90 px-6 backdrop-blur md:px-10">
|
|
25
19
|
<button type="button" className="font-semibold" onClick={goHome}>
|
|
26
20
|
__LABEL__
|
|
@@ -30,52 +24,11 @@ export function Shell() {
|
|
|
30
24
|
</a>
|
|
31
25
|
</header>
|
|
32
26
|
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
</main>
|
|
27
|
+
<main className="min-w-0 pb-56">
|
|
28
|
+
<SpacefrontCanvas />
|
|
29
|
+
</main>
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
<div className="grid grow content-start gap-4 overflow-y-auto">
|
|
40
|
-
{isEmpty && <p className="text-ink/60">Tell us what you’re looking for.</p>}
|
|
41
|
-
{rows.map((row) => (
|
|
42
|
-
<div key={row.key} className="grid gap-1">
|
|
43
|
-
<p className="text-sm text-ink/60">{row.visitorText}</p>
|
|
44
|
-
<p>{renderInline(row.prose, row.key)}</p>
|
|
45
|
-
</div>
|
|
46
|
-
))}
|
|
47
|
-
{session.error && <p className="text-accent">{session.error}</p>}
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div className="flex flex-wrap gap-2">
|
|
51
|
-
{chips.map((chip) => (
|
|
52
|
-
<button key={chip.id} type="button" className="rounded-full border border-ink/20 px-3 py-1 text-sm" onClick={() => selectChip(chip)}>
|
|
53
|
-
{chip.label}
|
|
54
|
-
</button>
|
|
55
|
-
))}
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<form
|
|
59
|
-
className="flex gap-3"
|
|
60
|
-
onSubmit={(event) => {
|
|
61
|
-
event.preventDefault();
|
|
62
|
-
if (draft.trim() === '') return;
|
|
63
|
-
session.sendMessage(draft);
|
|
64
|
-
setDraft('');
|
|
65
|
-
}}
|
|
66
|
-
>
|
|
67
|
-
<input
|
|
68
|
-
className="w-full border-b border-ink/20 bg-transparent py-2 outline-none focus:border-ink"
|
|
69
|
-
placeholder="Ask anything…"
|
|
70
|
-
value={draft}
|
|
71
|
-
onChange={(event) => setDraft(event.target.value)}
|
|
72
|
-
/>
|
|
73
|
-
<button type="submit" className="rounded bg-ink px-4 text-paper disabled:opacity-50" disabled={session.isRunning}>
|
|
74
|
-
Ask
|
|
75
|
-
</button>
|
|
76
|
-
</form>
|
|
77
|
-
</aside>
|
|
78
|
-
</div>
|
|
31
|
+
<SpacefrontIsland />
|
|
79
32
|
</div>
|
|
80
33
|
);
|
|
81
34
|
}
|
|
@@ -7,4 +7,11 @@
|
|
|
7
7
|
--color-ink: 20 20 20;
|
|
8
8
|
--color-paper: 250 250 249;
|
|
9
9
|
--color-accent: 191 72 0;
|
|
10
|
+
|
|
11
|
+
/* The AMS island (`@40rty/ams-ui/island`), in the same tokens. */
|
|
12
|
+
--fourty-island-surface: rgb(var(--color-paper));
|
|
13
|
+
--fourty-island-fg: rgb(var(--color-ink));
|
|
14
|
+
--fourty-island-accent: rgb(var(--color-accent));
|
|
15
|
+
--fourty-island-accent-fg: rgb(var(--color-paper));
|
|
16
|
+
--fourty-island-error: rgb(var(--color-accent));
|
|
10
17
|
}
|