@sixb/agent 0.2.4 → 0.2.6
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 +2 -2
- package/dist/agent-prompt.d.ts +13 -3
- package/dist/agent-prompt.d.ts.map +1 -1
- package/dist/artifacts/layout-check/layout-check.d.ts +21 -24
- package/dist/artifacts/layout-check/layout-check.d.ts.map +1 -1
- package/dist/artifacts/publish-tool.d.ts.map +1 -1
- package/dist/background-commands.d.ts +2 -2
- package/dist/context-compaction.d.ts.map +1 -1
- package/dist/conversation-messages.d.ts +1 -1
- package/dist/conversation-messages.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11082 -9281
- package/dist/index.js.map +37 -33
- package/dist/login-shell.d.ts +18 -2
- package/dist/login-shell.d.ts.map +1 -1
- package/dist/model-adapters.d.ts +5 -2
- package/dist/model-adapters.d.ts.map +1 -1
- package/dist/model-lines.d.ts +1 -0
- package/dist/model-lines.d.ts.map +1 -1
- package/dist/run-agent-turn.d.ts +3 -14
- package/dist/run-agent-turn.d.ts.map +1 -1
- package/dist/run-conversation-turn.d.ts.map +1 -1
- package/dist/run-environment.d.ts.map +1 -1
- package/dist/run-sandbox.d.ts +11 -1
- package/dist/run-sandbox.d.ts.map +1 -1
- package/dist/run-subagent.d.ts.map +1 -1
- package/dist/sandbox-api-context.d.ts.map +1 -1
- package/dist/search-script.d.ts +7 -0
- package/dist/search-script.d.ts.map +1 -0
- package/dist/skills/built-in.d.ts.map +1 -1
- package/dist/subagent-tools.d.ts +11 -1
- package/dist/subagent-tools.d.ts.map +1 -1
- package/dist/tools/bash.d.ts +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/glob.d.ts +41 -0
- package/dist/tools/glob.d.ts.map +1 -0
- package/dist/tools/grep.d.ts +64 -0
- package/dist/tools/grep.d.ts.map +1 -0
- package/dist/tools/model-spec.d.ts.map +1 -1
- package/dist/tools/sandbox-search.d.ts +26 -0
- package/dist/tools/sandbox-search.d.ts.map +1 -0
- package/dist/tools/search/command.d.ts +15 -0
- package/dist/tools/search/command.d.ts.map +1 -0
- package/dist/tools/search/gitignore.d.ts +28 -0
- package/dist/tools/search/gitignore.d.ts.map +1 -0
- package/dist/tools/search/glob.d.ts +15 -0
- package/dist/tools/search/glob.d.ts.map +1 -0
- package/dist/tools/search/main.d.ts +2 -0
- package/dist/tools/search/main.d.ts.map +1 -0
- package/dist/tools/search/match.d.ts +30 -0
- package/dist/tools/search/match.d.ts.map +1 -0
- package/dist/tools/search/pattern.d.ts +19 -0
- package/dist/tools/search/pattern.d.ts.map +1 -0
- package/dist/tools/search/read.d.ts +62 -0
- package/dist/tools/search/read.d.ts.map +1 -0
- package/dist/tools/search/request.d.ts +80 -0
- package/dist/tools/search/request.d.ts.map +1 -0
- package/dist/tools/search/search.d.ts +4 -0
- package/dist/tools/search/search.d.ts.map +1 -0
- package/dist/tools/search/walk.d.ts +43 -0
- package/dist/tools/search/walk.d.ts.map +1 -0
- package/dist/tools/tool-outputs.d.ts.map +1 -1
- package/dist/turn-inbox.d.ts +75 -0
- package/dist/turn-inbox.d.ts.map +1 -0
- package/package.json +7 -5
- package/src/agent-prompt.ts +63 -28
- package/src/agent-runtime/preflight.ts +1 -0
- package/src/artifacts/layout-check/check.cjs +176 -95
- package/src/artifacts/layout-check/layout-check.ts +118 -76
- package/src/artifacts/publish-tool.ts +48 -99
- package/src/background-commands.ts +8 -6
- package/src/context-compaction.ts +1 -0
- package/src/conversation-messages.ts +11 -4
- package/src/generated/search.mjs +985 -0
- package/src/index.ts +0 -1
- package/src/login-shell.ts +30 -3
- package/src/model-adapters.ts +23 -4
- package/src/model-lines.ts +1 -1
- package/src/run-agent-turn.ts +85 -129
- package/src/run-conversation-turn.ts +15 -6
- package/src/run-environment.ts +42 -11
- package/src/run-sandbox.ts +60 -1
- package/src/run-subagent.ts +9 -2
- package/src/sandbox-api-context.ts +10 -1
- package/src/search-script-assets.d.ts +5 -0
- package/src/search-script.ts +9 -0
- package/src/skills/built-in.ts +16 -0
- package/src/skills/sixb-artifacts/SKILL.md +7 -7
- package/src/skills/sixb-artifacts/canvas.md +3 -2
- package/src/skills/sixb-artifacts/document.md +92 -5
- package/src/skills/sixb-artifacts/examples/document/service-proposal/design.css +114 -0
- package/src/skills/sixb-artifacts/examples/document/service-proposal/document.html +159 -0
- package/src/skills/sixb-artifacts/examples/document/service-proposal/images/fieldwise.svg +1 -0
- package/src/skills/sixb-artifacts/examples/document/service-proposal/images/harbor-pine.svg +1 -0
- package/src/skills/sixb-artifacts/queries.md +2 -1
- package/src/subagent-tools.ts +23 -5
- package/src/tools/bash.ts +9 -10
- package/src/tools/glob.ts +124 -0
- package/src/tools/grep.ts +190 -0
- package/src/tools/model-spec.ts +4 -0
- package/src/tools/sandbox-search.ts +219 -0
- package/src/tools/search/command.ts +116 -0
- package/src/tools/search/gitignore.ts +101 -0
- package/src/tools/search/glob.ts +90 -0
- package/src/tools/search/main.ts +9 -0
- package/src/tools/search/match.ts +278 -0
- package/src/tools/search/pattern.ts +178 -0
- package/src/tools/search/read.ts +237 -0
- package/src/tools/search/request.ts +101 -0
- package/src/tools/search/search.ts +297 -0
- package/src/tools/search/walk.ts +145 -0
- package/src/tools/tool-outputs.ts +7 -2
- package/src/turn-inbox.ts +283 -0
- package/dist/artifacts/board-previews.d.ts +0 -41
- package/dist/artifacts/board-previews.d.ts.map +0 -1
- package/src/artifacts/board-previews.ts +0 -218
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* The paper: US Letter with its margins. Pages and the PDF are cut from it. */
|
|
2
|
+
@page { size: letter; margin: 0.72in 0.84in; }
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--accent: #0f766e;
|
|
6
|
+
--ink: #18181b;
|
|
7
|
+
--muted: #71717a;
|
|
8
|
+
--rule: #e4e4e7;
|
|
9
|
+
--wash: #f0fdfa;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
body {
|
|
13
|
+
color: var(--ink);
|
|
14
|
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
15
|
+
font-size: 10pt;
|
|
16
|
+
line-height: 1.6;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; break-after: avoid; }
|
|
20
|
+
h2 { margin-bottom: 12px; font-size: 14pt; line-height: 1.25; }
|
|
21
|
+
h3 { margin: 20px 0 6px; font-size: 10.5pt; }
|
|
22
|
+
p { margin: 0 0 10px; }
|
|
23
|
+
ul, ol { margin: 0 0 12px; padding-left: 20px; }
|
|
24
|
+
li + li { margin-top: 4px; }
|
|
25
|
+
strong { font-weight: 700; }
|
|
26
|
+
|
|
27
|
+
.section-number { color: var(--accent); }
|
|
28
|
+
.page { break-before: page; }
|
|
29
|
+
|
|
30
|
+
/* The cover fills its page; the facts sit at its foot. */
|
|
31
|
+
.cover { display: flex; flex-direction: column; min-height: 9.4in; }
|
|
32
|
+
.cover header { display: flex; align-items: flex-start; justify-content: space-between; }
|
|
33
|
+
.logos { display: flex; align-items: center; gap: 18px; }
|
|
34
|
+
.logos img + img { padding-left: 18px; border-left: 1px solid var(--rule); }
|
|
35
|
+
.eyebrow {
|
|
36
|
+
margin: 0;
|
|
37
|
+
color: var(--muted);
|
|
38
|
+
font-size: 7pt;
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
letter-spacing: 0.14em;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
}
|
|
43
|
+
.cover h1 { margin-top: 88px; font-size: 30pt; line-height: 1.1; letter-spacing: -0.03em; }
|
|
44
|
+
.prepared-for { margin-top: 14px; color: #52525b; }
|
|
45
|
+
.summary { margin-top: 44px; padding-top: 22px; border-top: 2px solid var(--accent); }
|
|
46
|
+
.summary .eyebrow { margin-bottom: 10px; color: var(--ink); }
|
|
47
|
+
.facts {
|
|
48
|
+
display: grid;
|
|
49
|
+
grid-template-columns: repeat(3, 1fr);
|
|
50
|
+
gap: 24px;
|
|
51
|
+
margin-top: auto;
|
|
52
|
+
padding-top: 16px;
|
|
53
|
+
border-top: 1px solid var(--rule);
|
|
54
|
+
}
|
|
55
|
+
.facts p { margin: 6px 0 0; font-size: 8.5pt; }
|
|
56
|
+
|
|
57
|
+
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
|
|
58
|
+
.columns h3 { margin-top: 0; padding-top: 10px; border-top: 1px solid var(--rule); }
|
|
59
|
+
.callout { margin: 18px 0; padding: 14px 16px; border: 1px solid #ccfbf1; background: var(--wash); }
|
|
60
|
+
.callout p:last-child { margin-bottom: 0; }
|
|
61
|
+
|
|
62
|
+
/* A numbered timeline down the page. */
|
|
63
|
+
.timeline { margin: 18px 0; padding: 0; list-style: none; }
|
|
64
|
+
.timeline li { position: relative; margin: 0; padding: 0 0 16px 40px; break-inside: avoid; }
|
|
65
|
+
.timeline li::before {
|
|
66
|
+
content: counter(list-item, decimal-leading-zero);
|
|
67
|
+
position: absolute;
|
|
68
|
+
left: 0;
|
|
69
|
+
top: 0;
|
|
70
|
+
width: 22px;
|
|
71
|
+
height: 22px;
|
|
72
|
+
border: 1px solid #99f6e4;
|
|
73
|
+
border-radius: 50%;
|
|
74
|
+
background: var(--wash);
|
|
75
|
+
color: var(--accent);
|
|
76
|
+
font-size: 6.5pt;
|
|
77
|
+
line-height: 20px;
|
|
78
|
+
text-align: center;
|
|
79
|
+
}
|
|
80
|
+
.timeline li:not(:last-child)::after {
|
|
81
|
+
content: "";
|
|
82
|
+
position: absolute;
|
|
83
|
+
left: 11px;
|
|
84
|
+
top: 26px;
|
|
85
|
+
bottom: 2px;
|
|
86
|
+
border-left: 1px solid var(--rule);
|
|
87
|
+
}
|
|
88
|
+
.timeline strong { display: block; }
|
|
89
|
+
.timeline p { margin: 2px 0 0; color: #52525b; }
|
|
90
|
+
|
|
91
|
+
table { width: 100%; margin: 12px 0 20px; border: 1px solid var(--rule); border-collapse: collapse; }
|
|
92
|
+
thead { display: table-header-group; }
|
|
93
|
+
th, td { padding: 7px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
|
|
94
|
+
th { color: var(--muted); font-size: 6.5pt; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; background: #fafafa; }
|
|
95
|
+
tr { break-inside: avoid; }
|
|
96
|
+
.amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
97
|
+
tfoot td { font-weight: 700; }
|
|
98
|
+
|
|
99
|
+
/* Two parties side by side, a line to sign on each. */
|
|
100
|
+
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); break-inside: avoid; }
|
|
101
|
+
.signature-line { height: 44px; border-bottom: 1px solid #a1a1aa; }
|
|
102
|
+
.signatures .name { margin: 8px 0 0; font-weight: 600; }
|
|
103
|
+
.signatures .organization { margin: 0; color: var(--muted); font-size: 8pt; }
|
|
104
|
+
.signatures .dated { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
|
|
105
|
+
.signatures .dated span { display: block; padding-top: 22px; border-bottom: 1px solid #a1a1aa; color: var(--muted); font-size: 6.5pt; letter-spacing: 0.1em; text-transform: uppercase; }
|
|
106
|
+
|
|
107
|
+
/* On a phone the document is one sheet at the screen's width: the grids stack. */
|
|
108
|
+
@media screen and (max-width: 600px) {
|
|
109
|
+
.cover { min-height: 0; }
|
|
110
|
+
.columns, .facts, .signatures { grid-template-columns: 1fr; }
|
|
111
|
+
.cover header { flex-direction: column; gap: 12px; }
|
|
112
|
+
.cover h1 { margin-top: 48px; }
|
|
113
|
+
.logos { flex-wrap: wrap; }
|
|
114
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Harbor & Pine Landscaping: job flow proposal</title>
|
|
6
|
+
<link rel="stylesheet" href="design.css">
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<section class="cover">
|
|
10
|
+
<header>
|
|
11
|
+
<div class="logos">
|
|
12
|
+
<img src="images/fieldwise.svg" alt="Fieldwise" width="132" height="32">
|
|
13
|
+
<img src="images/harbor-pine.svg" alt="Harbor & Pine Landscaping" width="150" height="32">
|
|
14
|
+
</div>
|
|
15
|
+
<p class="eyebrow">Service proposal</p>
|
|
16
|
+
</header>
|
|
17
|
+
|
|
18
|
+
<h1>Harbor & Pine Landscaping</h1>
|
|
19
|
+
<p class="prepared-for">Prepared for <strong>Harbor & Pine Landscaping LLC</strong> · Dana Reyes</p>
|
|
20
|
+
|
|
21
|
+
<div class="summary">
|
|
22
|
+
<p class="eyebrow">Executive summary</p>
|
|
23
|
+
<p>Fieldwise will build one system around the way Harbor & Pine already works. It connects
|
|
24
|
+
to QuickBooks, so the books stay where they are, and gives every job one path from first
|
|
25
|
+
call to paid that the whole crew can see.</p>
|
|
26
|
+
<p>The work takes about five weeks for a fixed fee of <strong>$4,000</strong>, with hosting
|
|
27
|
+
and maintenance at <strong>$200 a month</strong> after delivery.</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="facts">
|
|
31
|
+
<div><p class="eyebrow">Prepared by</p><p>Sam Okafor · Fieldwise</p></div>
|
|
32
|
+
<div><p class="eyebrow">Proposal date</p><p>November 5, 2026</p></div>
|
|
33
|
+
<div><p class="eyebrow">Valid until</p><p>December 5, 2026</p></div>
|
|
34
|
+
</div>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<section class="page">
|
|
38
|
+
<h2><span class="section-number">1.</span> What changes for Harbor & Pine</h2>
|
|
39
|
+
<div class="columns">
|
|
40
|
+
<div>
|
|
41
|
+
<h3>What we heard</h3>
|
|
42
|
+
<p>The business runs through Dana: calls, texts and what she keeps in her head. There is no
|
|
43
|
+
shared schedule, so the crew gets its plan from talking to her.</p>
|
|
44
|
+
<p>The aim is not more work, but the same work running smoothly without everything passing
|
|
45
|
+
through one person.</p>
|
|
46
|
+
</div>
|
|
47
|
+
<div>
|
|
48
|
+
<h3>What we saw in the books</h3>
|
|
49
|
+
<p>Work ranges from large custom projects to recurring maintenance and snow contracts.</p>
|
|
50
|
+
<p>Many estimates stay marked pending, so QuickBooks can't tell which ones are still
|
|
51
|
+
live.</p>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<h3>What we propose</h3>
|
|
55
|
+
<p>Keep what already works, walking the site and QuickBooks doing the books, and add one path
|
|
56
|
+
every job follows:</p>
|
|
57
|
+
<p><strong>Call → Site visit → Estimate → Won → Scheduled → In progress → Invoiced → Paid</strong></p>
|
|
58
|
+
<div class="callout">
|
|
59
|
+
<p><strong>The goal</strong></p>
|
|
60
|
+
<p>The same business, running more smoothly, with work moving through the company without
|
|
61
|
+
Dana carrying all of it.</p>
|
|
62
|
+
</div>
|
|
63
|
+
</section>
|
|
64
|
+
|
|
65
|
+
<section class="page">
|
|
66
|
+
<h2><span class="section-number">2.</span> Scope of work</h2>
|
|
67
|
+
<p>Fieldwise builds an app on top of QuickBooks, for the office computer and the crew's
|
|
68
|
+
phones. QuickBooks keeps the books; the app handles everything around each job.</p>
|
|
69
|
+
<h3>What we'll deliver</h3>
|
|
70
|
+
<ol>
|
|
71
|
+
<li><strong>Every job in one place.</strong> From first call to paid, including annual
|
|
72
|
+
contracts.</li>
|
|
73
|
+
<li><strong>Site visits to estimates.</strong> Photos and notes become a draft estimate you
|
|
74
|
+
price and send through QuickBooks.</li>
|
|
75
|
+
<li><strong>One shared schedule.</strong> The crew knows where to go, and customers get
|
|
76
|
+
updates.</li>
|
|
77
|
+
<li><strong>Extras and invoices.</strong> Approved extras carry onto the invoice, and payments
|
|
78
|
+
show on the job.</li>
|
|
79
|
+
</ol>
|
|
80
|
+
<h3>Your part</h3>
|
|
81
|
+
<ul>
|
|
82
|
+
<li>QuickBooks Online admin access</li>
|
|
83
|
+
<li>Your estimate terms and conditions</li>
|
|
84
|
+
<li>A short check-in each week</li>
|
|
85
|
+
</ul>
|
|
86
|
+
<h3>Not included</h3>
|
|
87
|
+
<p>Payroll, time tracking, and a customer login or portal.</p>
|
|
88
|
+
</section>
|
|
89
|
+
|
|
90
|
+
<section class="page">
|
|
91
|
+
<h2><span class="section-number">3.</span> Timeline</h2>
|
|
92
|
+
<p>Delivery is about three weeks from kickoff, with a review as each part comes together.</p>
|
|
93
|
+
<ol class="timeline">
|
|
94
|
+
<li><strong>Week 1: Kickoff and QuickBooks</strong>
|
|
95
|
+
<p>Connect QuickBooks and bring in customers, estimates, invoices and payments.</p></li>
|
|
96
|
+
<li><strong>Weeks 1–2: Jobs and customers</strong>
|
|
97
|
+
<p>Build the Today page, the jobs board and customer pages, then review them with you.</p></li>
|
|
98
|
+
<li><strong>Week 2: Site visits and estimates</strong>
|
|
99
|
+
<p>Build site visit capture and drafted estimates, then try them on a real job.</p></li>
|
|
100
|
+
<li><strong>Weeks 2–3: Schedule, crew and invoices</strong>
|
|
101
|
+
<p>Build the calendar, the crew view, extras and invoices.</p></li>
|
|
102
|
+
<li><strong>Weeks 4–5: Fixes and small changes</strong>
|
|
103
|
+
<p>Fix what comes up as you use it on real jobs.</p></li>
|
|
104
|
+
</ol>
|
|
105
|
+
</section>
|
|
106
|
+
|
|
107
|
+
<section class="page">
|
|
108
|
+
<h2><span class="section-number">4.</span> Pricing and payment terms</h2>
|
|
109
|
+
<p>The full scope is delivered for a <strong>fixed fee of $4,000</strong>.</p>
|
|
110
|
+
<table>
|
|
111
|
+
<thead><tr><th>Item</th><th>Includes</th><th class="amount">Fee</th></tr></thead>
|
|
112
|
+
<tbody>
|
|
113
|
+
<tr><td>Setup</td><td>Kickoff, QuickBooks connection, hosting, sign-in</td><td class="amount">$500</td></tr>
|
|
114
|
+
<tr><td>Jobs and customers</td><td>Today page, jobs board, customer pages</td><td class="amount">$900</td></tr>
|
|
115
|
+
<tr><td>Site visits and estimates</td><td>Photos, notes, drafted estimates in QuickBooks</td><td class="amount">$900</td></tr>
|
|
116
|
+
<tr><td>Schedule and crew</td><td>Shared calendar, crew view</td><td class="amount">$450</td></tr>
|
|
117
|
+
<tr><td>Extras and invoices</td><td>Approved extras, invoices in QuickBooks</td><td class="amount">$500</td></tr>
|
|
118
|
+
<tr><td>Testing and fixes</td><td>Real data testing, walkthrough, fixes</td><td class="amount">$750</td></tr>
|
|
119
|
+
</tbody>
|
|
120
|
+
<tfoot><tr><td colspan="2">Total fixed fee</td><td class="amount">$4,000</td></tr></tfoot>
|
|
121
|
+
</table>
|
|
122
|
+
<h3>Payment schedule</h3>
|
|
123
|
+
<table>
|
|
124
|
+
<thead><tr><th>Payment</th><th>When</th><th class="amount">Amount</th></tr></thead>
|
|
125
|
+
<tbody>
|
|
126
|
+
<tr><td>Kickoff</td><td>When work starts</td><td class="amount">$2,000</td></tr>
|
|
127
|
+
<tr><td>Delivery</td><td>When it is delivered</td><td class="amount">$2,000</td></tr>
|
|
128
|
+
</tbody>
|
|
129
|
+
</table>
|
|
130
|
+
<p>Invoices are due within 30 days.</p>
|
|
131
|
+
<h3>Hosting and maintenance</h3>
|
|
132
|
+
<p><strong>$200 a month</strong> after delivery, covering hosting, updates and fixes. Either
|
|
133
|
+
party can end it with 30 days' notice.</p>
|
|
134
|
+
</section>
|
|
135
|
+
|
|
136
|
+
<section class="page">
|
|
137
|
+
<h2><span class="section-number">5.</span> Acceptance and next steps</h2>
|
|
138
|
+
<p>By signing below, Harbor & Pine Landscaping LLC authorizes Fieldwise to proceed with the
|
|
139
|
+
scope above for a fixed fee of <strong>$4,000</strong>, with hosting and maintenance at
|
|
140
|
+
<strong>$200 a month</strong> after delivery. Once it's signed, we'll schedule the kickoff.</p>
|
|
141
|
+
<div class="signatures">
|
|
142
|
+
<div>
|
|
143
|
+
<p class="eyebrow">For the service provider</p>
|
|
144
|
+
<div class="signature-line"></div>
|
|
145
|
+
<p class="name">Sam Okafor</p>
|
|
146
|
+
<p class="organization">Fieldwise</p>
|
|
147
|
+
<div class="dated"><span>Title</span><span>Date</span></div>
|
|
148
|
+
</div>
|
|
149
|
+
<div>
|
|
150
|
+
<p class="eyebrow">Accepted and agreed</p>
|
|
151
|
+
<div class="signature-line"></div>
|
|
152
|
+
<p class="name">Dana Reyes</p>
|
|
153
|
+
<p class="organization">Harbor & Pine Landscaping LLC</p>
|
|
154
|
+
<div class="dated"><span>Title</span><span>Date</span></div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</section>
|
|
158
|
+
</body>
|
|
159
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="132" height="32" viewBox="0 0 132 32"><path d="M2 26 L14 4 L26 26 Z" fill="#0f766e"/><path d="M14 4 L26 26 L18 26 Z" fill="#115e59"/><text x="34" y="23" font-family="Helvetica, Arial, sans-serif" font-size="19" font-weight="700" letter-spacing="-0.4" fill="#18181b">Fieldwise</text></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="150" height="32" viewBox="0 0 150 32"><circle cx="14" cy="16" r="12" fill="none" stroke="#3f3f46" stroke-width="2"/><path d="M14 7 L20 19 H8 Z M14 13 L21 25 H7 Z" fill="#3f3f46"/><text x="34" y="15" font-family="Georgia, serif" font-size="12" letter-spacing="1.6" fill="#27272a">HARBOR & PINE</text><text x="34" y="27" font-family="Helvetica, Arial, sans-serif" font-size="7.5" letter-spacing="2.4" fill="#71717a">LANDSCAPING</text></svg>
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
A query reads the project's objects each time the artifact is opened, as whoever opens it: they see
|
|
4
4
|
the rows they may view, and a value they are not cleared for shows locked. Data from the project
|
|
5
5
|
goes in a query, not a copy, so the artifact stays current: a sheet shows its rows (`sheet.md`, Live
|
|
6
|
-
rows),
|
|
6
|
+
rows), a page, a deck, or a canvas board reads them with `sixb.query` (`page.md`), and a designed
|
|
7
|
+
document shows them in its fields (`document.md`, Live data).
|
|
7
8
|
|
|
8
9
|
## Write one
|
|
9
10
|
|
package/src/subagent-tools.ts
CHANGED
|
@@ -240,7 +240,9 @@ export class SubagentCoordinator {
|
|
|
240
240
|
* it claims the child's run, opens its session and environment, and records its fate.
|
|
241
241
|
* Starting a run already running is a no-op.
|
|
242
242
|
*/
|
|
243
|
-
private readonly startChild: (run: SubagentRunRecord, family: FamilyMailbox) => void
|
|
243
|
+
private readonly startChild: (run: SubagentRunRecord, family: FamilyMailbox) => void,
|
|
244
|
+
/** When the parent conversation last moved workspaces, so paused child sandboxes know. */
|
|
245
|
+
private readonly movedAt?: Date
|
|
244
246
|
) {
|
|
245
247
|
this.models = delegation.models
|
|
246
248
|
}
|
|
@@ -293,7 +295,8 @@ export class SubagentCoordinator {
|
|
|
293
295
|
for (const { child, outcomes } of paused) {
|
|
294
296
|
signal.throwIfAborted()
|
|
295
297
|
await this.clearDeadAttempts(child, signal)
|
|
296
|
-
const
|
|
298
|
+
const keepsWorkspace = await this.childKeepsWorkspace(child)
|
|
299
|
+
const { spec, continuation } = this.continuationOf(child, outcomes, keepsWorkspace)
|
|
297
300
|
await this.admitInTurn(() =>
|
|
298
301
|
this.admit(
|
|
299
302
|
createSubagentRunId(this.parentRun.id, child.spawnKey),
|
|
@@ -621,7 +624,8 @@ export class SubagentCoordinator {
|
|
|
621
624
|
)
|
|
622
625
|
}
|
|
623
626
|
await this.clearDeadAttempts(paused, signal)
|
|
624
|
-
const
|
|
627
|
+
const keepsWorkspace = await this.childKeepsWorkspace(paused)
|
|
628
|
+
const { spec, continuation } = this.continuationOf(paused, [answer], keepsWorkspace)
|
|
625
629
|
return this.admit(runId, key, spec, signal, continuation)
|
|
626
630
|
})
|
|
627
631
|
|
|
@@ -886,6 +890,19 @@ export class SubagentCoordinator {
|
|
|
886
890
|
return null
|
|
887
891
|
}
|
|
888
892
|
|
|
893
|
+
/**
|
|
894
|
+
* Whether a paused child finds its workspace where it left it: its provider keeps them, the
|
|
895
|
+
* conversation did not move to a computer since it paused, and it did not move to another
|
|
896
|
+
* workspace before that pause ended.
|
|
897
|
+
*/
|
|
898
|
+
private async childKeepsWorkspace(paused: SubagentRunRecord): Promise<boolean> {
|
|
899
|
+
if (!this.context.keepsChildWorkspaces) return false
|
|
900
|
+
const parent = await this.session.children.get(paused.parentRunId)
|
|
901
|
+
if (parent?.kind === "conversation" && parent.spec?.runsOn === "computer") return false
|
|
902
|
+
const pausedAt = paused.completedAt ?? paused.startedAt ?? paused.createdAt
|
|
903
|
+
return !this.movedAt || this.movedAt.getTime() <= pausedAt.getTime()
|
|
904
|
+
}
|
|
905
|
+
|
|
889
906
|
/**
|
|
890
907
|
* The run of this turn that continues `paused` in its thread: its model, task and files, this
|
|
891
908
|
* turn's mode, and a trigger of what it goes on with (the outcomes of its calls, or
|
|
@@ -893,7 +910,8 @@ export class SubagentCoordinator {
|
|
|
893
910
|
*/
|
|
894
911
|
private continuationOf(
|
|
895
912
|
paused: SubagentRunRecord,
|
|
896
|
-
goesOnWith: readonly AgentMessagePart[]
|
|
913
|
+
goesOnWith: readonly AgentMessagePart[],
|
|
914
|
+
keepsWorkspace: boolean
|
|
897
915
|
): {
|
|
898
916
|
readonly spec: SubagentRunSpec
|
|
899
917
|
readonly continuation: Pick<AgentChildDraft, "thread" | "trigger" | "createdAt">
|
|
@@ -910,7 +928,7 @@ export class SubagentCoordinator {
|
|
|
910
928
|
const parts = continuationTrigger({
|
|
911
929
|
goesOnWith,
|
|
912
930
|
paused,
|
|
913
|
-
keepsWorkspace
|
|
931
|
+
keepsWorkspace,
|
|
914
932
|
createdAt,
|
|
915
933
|
settings: sentSettings(spec, this.context),
|
|
916
934
|
})
|
package/src/tools/bash.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CommandResult } from "@sixb/core"
|
|
2
2
|
import type { JsonObject, JsonValue, ModelTool } from "@sixb/core/models"
|
|
3
3
|
import type { BackgroundCommandState, BackgroundCommands } from "../background-commands"
|
|
4
|
-
import { loginShellArgs } from "../login-shell"
|
|
4
|
+
import { commandDirectory, loginShellArgs } from "../login-shell"
|
|
5
|
+
import { agentToolErrorText } from "../model-adapters"
|
|
5
6
|
import type { AgentSandboxHandle } from "../sandbox-handle"
|
|
6
7
|
|
|
7
8
|
/** Long enough for a build or a test suite; the model asks for more when it expects longer. */
|
|
@@ -84,12 +85,11 @@ export function createBashTool(
|
|
|
84
85
|
|
|
85
86
|
const { sandbox, env } = await resolveSandbox()
|
|
86
87
|
const timeout = normalizeTimeout(input.timeoutMs)
|
|
87
|
-
const result = await sandbox.runCommand(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
timeout,
|
|
91
|
-
|
|
92
|
-
})
|
|
88
|
+
const result = await sandbox.runCommand(
|
|
89
|
+
"bash",
|
|
90
|
+
loginShellArgs(input.command, commandDirectory(sandbox.workingDirectory, input.cwd)),
|
|
91
|
+
{ env, timeout, signal }
|
|
92
|
+
)
|
|
93
93
|
|
|
94
94
|
const output: BashToolOutput = {
|
|
95
95
|
...result,
|
|
@@ -100,8 +100,7 @@ export function createBashTool(
|
|
|
100
100
|
return output as unknown as JsonValue
|
|
101
101
|
},
|
|
102
102
|
// A background start says why it refused, such as too many running already.
|
|
103
|
-
errorText: (error) =>
|
|
104
|
-
error instanceof AgentToolPublicError ? error.message : "The command failed.",
|
|
103
|
+
errorText: (error) => agentToolErrorText(error, "The command failed."),
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
106
|
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { JsonObject, JsonValue, ModelTool } from "@sixb/core/models"
|
|
2
|
+
import { agentToolErrorText } from "../model-adapters"
|
|
3
|
+
import type { AgentSandboxHandle } from "../sandbox-handle"
|
|
4
|
+
import { objectInput } from "./edit"
|
|
5
|
+
import { publicError } from "./file-writes"
|
|
6
|
+
import {
|
|
7
|
+
INCOMPLETE_SEARCH_FOOTER,
|
|
8
|
+
isRecord,
|
|
9
|
+
optionalPathInput,
|
|
10
|
+
runSandboxSearch,
|
|
11
|
+
searchUnavailable,
|
|
12
|
+
} from "./sandbox-search"
|
|
13
|
+
import type { GlobSearchResult } from "./search/request"
|
|
14
|
+
|
|
15
|
+
export const GLOB_TOOL_SPEC = {
|
|
16
|
+
name: "glob",
|
|
17
|
+
strict: true,
|
|
18
|
+
description:
|
|
19
|
+
"Find files by name. A pattern without / matches at any depth (*.md finds every Markdown file); one with / matches from path (src/**/*.ts). Supports *, **, ?, [abc] and {a,b}. Skips .git and what .gitignore excludes, and hidden files and node_modules unless the pattern names them. Returns at most 100 paths, sorted. Prefer this over bash to find files.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
pattern: { type: "string", description: "Glob pattern, relative to path." },
|
|
24
|
+
path: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description:
|
|
27
|
+
"Folder to search: relative to the working directory, or an absolute path in the run's context directory. Default: the working directory.",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
required: ["pattern"],
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
} satisfies JsonObject,
|
|
33
|
+
} as const
|
|
34
|
+
|
|
35
|
+
export interface GlobToolInput {
|
|
36
|
+
readonly pattern: string
|
|
37
|
+
readonly path?: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface GlobToolOutput {
|
|
41
|
+
readonly pattern: string
|
|
42
|
+
/** As the call named it; `.` for the working directory. */
|
|
43
|
+
readonly path: string
|
|
44
|
+
/** Relative to the working directory when under it, absolute otherwise. */
|
|
45
|
+
readonly files: readonly string[]
|
|
46
|
+
/** More files match than the 100 listed. */
|
|
47
|
+
readonly truncated: boolean
|
|
48
|
+
/** The search stopped at its deadline. */
|
|
49
|
+
readonly incomplete?: true
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function createGlobTool(
|
|
53
|
+
resolveSandbox: () => Promise<AgentSandboxHandle>
|
|
54
|
+
): ModelTool<GlobToolInput> {
|
|
55
|
+
return {
|
|
56
|
+
...GLOB_TOOL_SPEC,
|
|
57
|
+
parseInput: parseGlobInput,
|
|
58
|
+
async execute(input, { signal }): Promise<JsonValue> {
|
|
59
|
+
const handle = await resolveSandbox()
|
|
60
|
+
const result = await runSandboxSearch(handle, { tool: "glob", ...input }, signal)
|
|
61
|
+
if (!isGlobResult(result)) {
|
|
62
|
+
throw searchUnavailable(
|
|
63
|
+
"glob",
|
|
64
|
+
"its output could not be read",
|
|
65
|
+
new Error("Invalid sandbox output.")
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
pattern: input.pattern,
|
|
71
|
+
path: input.path ?? ".",
|
|
72
|
+
files: result.files,
|
|
73
|
+
truncated: result.truncated,
|
|
74
|
+
...(result.incomplete ? { incomplete: true } : {}),
|
|
75
|
+
} satisfies GlobToolOutput
|
|
76
|
+
},
|
|
77
|
+
toModelOutput(output) {
|
|
78
|
+
return { type: "text", value: globModelText(output as unknown as GlobToolOutput) }
|
|
79
|
+
},
|
|
80
|
+
errorText: agentToolErrorText,
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** One path per line, then what the list leaves out. */
|
|
85
|
+
export function globModelText(output: GlobToolOutput): string {
|
|
86
|
+
const footers = [
|
|
87
|
+
...(output.truncated
|
|
88
|
+
? [`(${output.files.length} files shown, more match: narrow the pattern or the path)`]
|
|
89
|
+
: []),
|
|
90
|
+
...(output.incomplete ? [INCOMPLETE_SEARCH_FOOTER] : []),
|
|
91
|
+
]
|
|
92
|
+
const list = output.files.length > 0 ? output.files.join("\n") : "No files found"
|
|
93
|
+
return [list, ...footers].join("\n\n")
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function parseGlobInput(value: unknown): GlobToolInput {
|
|
97
|
+
const input = objectInput(value, "glob", ["pattern", "path"])
|
|
98
|
+
if (typeof input.pattern !== "string" || input.pattern === "") {
|
|
99
|
+
throw publicError("glob", "pattern must be a non-empty glob pattern.")
|
|
100
|
+
}
|
|
101
|
+
// Either would find nothing, and the model would read that nothing matches.
|
|
102
|
+
if (input.pattern.startsWith("/")) {
|
|
103
|
+
throw publicError(
|
|
104
|
+
"glob",
|
|
105
|
+
"pattern is relative to path: pass the folder as path and the rest as pattern."
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
if (input.pattern.endsWith("/")) {
|
|
109
|
+
throw publicError("glob", "glob finds files: drop the trailing /, or read the folder.")
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const path = optionalPathInput(input.path, "glob")
|
|
113
|
+
return { pattern: input.pattern, ...(path === undefined ? {} : { path }) }
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function isGlobResult(value: unknown): value is GlobSearchResult {
|
|
117
|
+
return (
|
|
118
|
+
isRecord(value) &&
|
|
119
|
+
Array.isArray(value.files) &&
|
|
120
|
+
value.files.every((file) => typeof file === "string") &&
|
|
121
|
+
typeof value.truncated === "boolean" &&
|
|
122
|
+
(value.incomplete === undefined || value.incomplete === true)
|
|
123
|
+
)
|
|
124
|
+
}
|