agentful 0.4.1 → 0.4.3
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/index.cjs +48 -28
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3044,7 +3044,7 @@ var VERSION, brand, useColor, wrap, paint, tuiDesign, sym, ui;
|
|
|
3044
3044
|
var init_branding = __esm({
|
|
3045
3045
|
"src/branding.ts"() {
|
|
3046
3046
|
"use strict";
|
|
3047
|
-
VERSION = "0.4.
|
|
3047
|
+
VERSION = "0.4.3" ? "0.4.3" : null.version;
|
|
3048
3048
|
brand = {
|
|
3049
3049
|
name: "agentful",
|
|
3050
3050
|
// the command users type
|
|
@@ -3068,8 +3068,6 @@ var init_branding = __esm({
|
|
|
3068
3068
|
bold: wrap("1")
|
|
3069
3069
|
};
|
|
3070
3070
|
tuiDesign = {
|
|
3071
|
-
/** Sits in front of the input line. U+276F, the shell prompt sigil. */
|
|
3072
|
-
promptMark: "\u276F",
|
|
3073
3071
|
/** Marks an item in progress in the sidebar's task list. U+203A. */
|
|
3074
3072
|
activeMark: "\u203A"
|
|
3075
3073
|
};
|
|
@@ -3510,7 +3508,6 @@ function brandingPluginSource() {
|
|
|
3510
3508
|
const logoLiteral = JSON.stringify(logo_default.replace(/\n+$/, "").split("\n"));
|
|
3511
3509
|
return `// Generated by ${brand.name} v${VERSION} \u2014 do not edit; rewritten on every start.
|
|
3512
3510
|
const LOGO = ${logoLiteral}
|
|
3513
|
-
const MARK = ${JSON.stringify(tuiDesign.promptMark)}
|
|
3514
3511
|
const ACTIVE = ${JSON.stringify(tuiDesign.activeMark)}
|
|
3515
3512
|
const USD = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' })
|
|
3516
3513
|
|
|
@@ -3667,7 +3664,17 @@ const plugin = {
|
|
|
3667
3664
|
}
|
|
3668
3665
|
|
|
3669
3666
|
// \u2500\u2500 prompt \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
3670
|
-
/**
|
|
3667
|
+
/**
|
|
3668
|
+
* Left half of the line under the input; replaces the engine's plain cwd.
|
|
3669
|
+
* Without a sessionID (the home screen) it falls back to the process
|
|
3670
|
+
* directory.
|
|
3671
|
+
*
|
|
3672
|
+
* The home screen needs it for a second reason: that line is
|
|
3673
|
+
* space-between, so with nothing on the left the engine's key hints
|
|
3674
|
+
* ("tab agents \xB7 ctrl+p commands") sit at column 0 \u2014 the one column the
|
|
3675
|
+
* clip below takes, which cost them their first character up to 0.4.2.
|
|
3676
|
+
* A hint on the left pushes them back to the right edge.
|
|
3677
|
+
*/
|
|
3671
3678
|
function Hint(props) {
|
|
3672
3679
|
const directory = () => safe(
|
|
3673
3680
|
() => api.state.session.get(props.sessionID).directory,
|
|
@@ -3683,31 +3690,43 @@ const plugin = {
|
|
|
3683
3690
|
}
|
|
3684
3691
|
|
|
3685
3692
|
/**
|
|
3686
|
-
*
|
|
3693
|
+
* The engine's own input, with its rail taken off.
|
|
3687
3694
|
*
|
|
3688
|
-
* The engine wraps
|
|
3695
|
+
* The engine wraps the input in a box with border ["left"] \u2014 the
|
|
3689
3696
|
* agent-coloured rail. There is no prop, config key or theme token that
|
|
3690
|
-
* hides it (checked against v1.18.18 and against main), so we clip it
|
|
3691
|
-
*
|
|
3692
|
-
*
|
|
3693
|
-
*
|
|
3697
|
+
* hides it (checked against v1.18.18 and against main), so we clip it:
|
|
3698
|
+
* the wrapper hides its overflow and the prompt hangs one column to the
|
|
3699
|
+
* left, which puts the rail outside the visible area. Everything else
|
|
3700
|
+
* keeps working because it is only a shift.
|
|
3694
3701
|
*
|
|
3695
|
-
* \u26A0\uFE0F
|
|
3696
|
-
*
|
|
3697
|
-
*
|
|
3698
|
-
*
|
|
3699
|
-
* the
|
|
3700
|
-
*
|
|
3702
|
+
* \u26A0\uFE0F The clip must NOT cover the whole component. api.ui.Prompt returns
|
|
3703
|
+
* TWO siblings: its own box, and the "/" + "@" completion list, which is
|
|
3704
|
+
* positioned absolutely ABOVE the input (a negative "top" against its
|
|
3705
|
+
* parent). A clip around both swallowed that list \u2014 the popup rendered
|
|
3706
|
+
* outside the clipped area, so it was never drawn and both triggers
|
|
3707
|
+
* looked dead while the keystrokes still went through (shipped in 0.4.2,
|
|
3708
|
+
* fixed here). So we take the children apart: the first goes inside the
|
|
3709
|
+
* clip, everything after it stays outside. The popup then anchors on the
|
|
3710
|
+
* outer box, which sits one column right of the shifted input \u2014 exactly
|
|
3711
|
+
* where its left edge belongs.
|
|
3712
|
+
*
|
|
3713
|
+
* \u26A0\uFE0F One column is the limit for the shift. The status line under the
|
|
3714
|
+
* input (our hint on the left) sits OUTSIDE that padded box and carries a
|
|
3715
|
+
* margin of just 1, so a wider clip eats the start of the working
|
|
3716
|
+
* directory \u2014 "/Users/\u2026" came out as "sers/\u2026" at -3. The rendering check
|
|
3717
|
+
* asserts the working directory, and the popup, for exactly this reason.
|
|
3701
3718
|
*/
|
|
3702
|
-
function
|
|
3719
|
+
function Field(props) {
|
|
3720
|
+
// Read once: in the engine's Solid runtime this getter runs the child
|
|
3721
|
+
// component, and each node may only be inserted into one parent.
|
|
3722
|
+
const parts = props.children
|
|
3723
|
+
const list = Array.isArray(parts) ? parts : [parts]
|
|
3703
3724
|
return (
|
|
3704
|
-
<box
|
|
3705
|
-
<box
|
|
3706
|
-
<
|
|
3707
|
-
</box>
|
|
3708
|
-
<box flexGrow={1} overflow="hidden">
|
|
3709
|
-
<box marginLeft={-1} width="100%">{props.children}</box>
|
|
3725
|
+
<box width="100%">
|
|
3726
|
+
<box width="100%" overflow="hidden">
|
|
3727
|
+
<box marginLeft={-1} width="100%">{list[0]}</box>
|
|
3710
3728
|
</box>
|
|
3729
|
+
{list.slice(1)}
|
|
3711
3730
|
</box>
|
|
3712
3731
|
)
|
|
3713
3732
|
}
|
|
@@ -3733,19 +3752,20 @@ const plugin = {
|
|
|
3733
3752
|
|
|
3734
3753
|
home_prompt(ctx, data) {
|
|
3735
3754
|
return (
|
|
3736
|
-
<
|
|
3755
|
+
<Field>
|
|
3737
3756
|
<Prompt
|
|
3738
3757
|
ref={data.ref}
|
|
3739
3758
|
placeholders={PLACEHOLDERS}
|
|
3759
|
+
hint={<Hint />}
|
|
3740
3760
|
right={<HostSlot name="home_prompt_right" />}
|
|
3741
3761
|
/>
|
|
3742
|
-
</
|
|
3762
|
+
</Field>
|
|
3743
3763
|
)
|
|
3744
3764
|
},
|
|
3745
3765
|
|
|
3746
3766
|
session_prompt(ctx, data) {
|
|
3747
3767
|
return (
|
|
3748
|
-
<
|
|
3768
|
+
<Field>
|
|
3749
3769
|
<Prompt
|
|
3750
3770
|
sessionID={data.session_id}
|
|
3751
3771
|
visible={data.visible}
|
|
@@ -3756,7 +3776,7 @@ const plugin = {
|
|
|
3756
3776
|
hint={<Hint sessionID={data.session_id} />}
|
|
3757
3777
|
right={<HostSlot name="session_prompt_right" session_id={data.session_id} />}
|
|
3758
3778
|
/>
|
|
3759
|
-
</
|
|
3779
|
+
</Field>
|
|
3760
3780
|
)
|
|
3761
3781
|
},
|
|
3762
3782
|
|