@kitman-sh/cli 0.11.7 → 0.12.0-rc.1
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/{chunk-y1rfbqaf.js → chunk-1sy32p83.js} +5 -4
- package/dist/{chunk-g31s31k7.js → chunk-66xhktcp.js} +162 -45
- package/dist/{chunk-0wv30032.js → chunk-82xjnghh.js} +3 -3
- package/dist/{chunk-ntfk63fx.js → chunk-8yyj061t.js} +1 -1
- package/dist/chunk-a8jgegds.js +13 -0
- package/dist/{chunk-sr6ag7ye.js → chunk-bjnvrsej.js} +69 -15
- package/dist/{chunk-5wvqtbfp.js → chunk-dc57c8s5.js} +21 -5
- package/dist/{chunk-z2dnw6ey.js → chunk-ejhfa1t6.js} +1 -1
- package/dist/{chunk-akzke77d.js → chunk-kfwp70pn.js} +2 -2
- package/dist/{chunk-8zg8nv7h.js → chunk-p3jbjz2a.js} +3 -3
- package/dist/{chunk-f3cbjk00.js → chunk-rm3vqk5d.js} +1 -1
- package/dist/{chunk-z9zqctv2.js → chunk-rr0yw34p.js} +1 -1
- package/dist/{chunk-m1sqgdym.js → chunk-s7xcdcqx.js} +175 -27
- package/dist/{chunk-c41b37fd.js → chunk-tcyqkqzj.js} +5 -5
- package/dist/chunk-wf8ajpyy.js +1460 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,1460 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// apps/mcp/src/docs/docs-index.generated.ts
|
|
3
|
+
var docsIndex = [
|
|
4
|
+
{
|
|
5
|
+
title: "Kitman CLI",
|
|
6
|
+
path: "cli",
|
|
7
|
+
level: 1,
|
|
8
|
+
link: "https://kitman.sh/knowledge/docs/cli",
|
|
9
|
+
text: "Pair a machine, repair a machine or checkout, and work with Kitman from a terminal.\n\nYou start in the web; see [Getting Started](/docs/getting-started). The CLI is for pairing a machine, repairing one, and working from a terminal. `kitman --help` lists every command, and `kitman <command> --help` (or `-h`) prints one command's usage, options and examples."
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: "Kitman CLI \u203A Pair a machine",
|
|
13
|
+
path: "cli#pair-a-machine",
|
|
14
|
+
level: 2,
|
|
15
|
+
link: "https://kitman.sh/knowledge/docs/cli#pair-a-machine",
|
|
16
|
+
text: "## Pair a machine\n\nThe **Set up your machine** step shows one command carrying a Pairing Code. It installs Bun, the CLI (`@kitman-sh/cli`) and [herdr-core](/docs/runner-operations#herdr-core) where missing, then runs:\n\n```sh\nkitman pair <pairing code>\n```\n\n`kitman pair` redeems the code for the same credentials `kitman login` stores and makes its Workspace the active one. It then registers this machine's personal Runner and keeps it running as a user service (systemd on Linux, launchd on macOS), and syncs the Kitman MCP server into each Harness it finds logged in. It asks nothing and opens no browser. A code works once and expires after 10 minutes: a reused, expired or mistyped code is refused, and the web mints another."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: "Kitman CLI \u203A Repair a machine or a checkout",
|
|
20
|
+
path: "cli#repair-a-machine-or-a-checkout",
|
|
21
|
+
level: 2,
|
|
22
|
+
link: "https://kitman.sh/knowledge/docs/cli#repair-a-machine-or-a-checkout",
|
|
23
|
+
text: "## Repair a machine or a checkout\n\nRun this in a repository when something looks wrong:\n\n```sh\nkitman init\n```\n\n`kitman init` reports what is already set up and repairs only what is missing, asking only where it has to choose:\n\n1. Logs you in through the browser.\n2. Picks your Workspace, or creates one.\n3. Binds this repository to your Workspace from its git remote, unless the Workspace already has it.\n4. Registers your personal Runner for this machine, or restores a lost Runner credential, and keeps it running as a user service.\n5. Syncs your harness: the Kitman MCP server and your Kits.\n6. Suggests verifications from the repository's `package.json` scripts (`typecheck`, `type-check`, `lint`, `test`, `check`). Runs use only the checks you approve.\n\n`kitman init --yes` accepts the defaults without asking, approving the suggested verifications.\n\nTo see this machine's Runners, their service state, Harnesses and SandboxBackends, and what each lacks:\n\n```sh\nkitman runner doctor\n```"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: "Kitman CLI \u203A Use Kitman from a terminal",
|
|
27
|
+
path: "cli#use-kitman-from-a-terminal",
|
|
28
|
+
level: 2,
|
|
29
|
+
link: "https://kitman.sh/knowledge/docs/cli#use-kitman-from-a-terminal",
|
|
30
|
+
text: `## Use Kitman from a terminal
|
|
31
|
+
|
|
32
|
+
Start a Run and follow it:
|
|
33
|
+
|
|
34
|
+
\`\`\`sh
|
|
35
|
+
kitman run start build "add SSO to the admin app"
|
|
36
|
+
kitman run wait <run> --until attention
|
|
37
|
+
kitman run answer <run> "<option or words>"
|
|
38
|
+
kitman run list
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
On a terminal, \`kitman run wait\` asks each open Question in turn: the options are numbered, the recommended one is marked with why, and Enter takes it. Type a number, the option itself, or your own words where the Question takes them. \`kitman run answer <run>\` with no answer asks the same way.
|
|
42
|
+
|
|
43
|
+
Read and act on your Inbox:
|
|
44
|
+
|
|
45
|
+
\`\`\`sh
|
|
46
|
+
kitman inbox --unread
|
|
47
|
+
kitman inbox my-teams
|
|
48
|
+
\`\`\`
|
|
49
|
+
|
|
50
|
+
Approve the verifications Runs use in the current repository:
|
|
51
|
+
|
|
52
|
+
\`\`\`sh
|
|
53
|
+
kitman verify list
|
|
54
|
+
kitman verify add test "bun run test"
|
|
55
|
+
\`\`\`
|
|
56
|
+
|
|
57
|
+
For a repository whose forge runs no pipeline, approve the command that runs it as its pipeline. Shepherd runs it on a Runner for each ChangeRequest head and reports the result:
|
|
58
|
+
|
|
59
|
+
\`\`\`sh
|
|
60
|
+
kitman verify add platform-quality scripts/ci-job.sh platform:quality --pipeline
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
Approve a check that reads the target branch, such as a migration history test that compares the branch's migrations with the target's, with \`--reads-target\`. Kitman holds a check's result per tree and reuses it, but this one's result holds only for the target it read, so it runs at every verify. Shepherd also runs it again when the target moves while a ChangeRequest waits for a person to merge, and merges the target in when it fails:
|
|
64
|
+
|
|
65
|
+
\`\`\`sh
|
|
66
|
+
kitman verify add migration-history bun run test:vitest packages/db/src/migration-history.test.ts --reads-target
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
Set up this machine's Harnesses from your Kits: the Workspace's, your Teams' and your own, with the Kitman MCP server. \`--harness\` narrows it to one of \`claude\`, \`codex\`, \`opencode\` or \`pi\`:
|
|
70
|
+
|
|
71
|
+
\`\`\`sh
|
|
72
|
+
kitman sync
|
|
73
|
+
kitman sync --harness codex
|
|
74
|
+
\`\`\`
|
|
75
|
+
|
|
76
|
+
List the Kits deployed and installed on the Workspace, a Team or yourself, and add, pin or remove one; see the [Kits Guide](/docs/kits):
|
|
77
|
+
|
|
78
|
+
\`\`\`sh
|
|
79
|
+
kitman kit list --team API
|
|
80
|
+
kitman kit add @acme/research --me
|
|
81
|
+
kitman kit remove @acme/research
|
|
82
|
+
\`\`\`
|
|
83
|
+
|
|
84
|
+
Each \`run\`, \`loop\`, \`agent\`, \`verify\`, \`constraint\`, \`secret\`, \`deploy\`, \`dev\` and \`kit\` command takes \`--json\`. See [Handing work to agents](/docs/handing-work-to-agents) and the [Loop Operations Guide](/docs/loop-operations).`
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: "Kitman CLI \u203A Search the docs",
|
|
88
|
+
path: "cli#search-the-docs",
|
|
89
|
+
level: 2,
|
|
90
|
+
link: "https://kitman.sh/knowledge/docs/cli#search-the-docs",
|
|
91
|
+
text: "## Search the docs\n\nKitman's guides and the SDK's types for Kits, Agents and Loops ship with the CLI, so a search matches the version you run and works offline:\n\n```sh\nkitman docs search \"agent fallbacks\"\nkitman docs read loop-operations#agents-and-effort\n```\n\nEach result names its path, which `kitman docs read` takes; a guide's own path, such as `kits`, reads the whole guide. Both take `--json`. In Code Mode, `kitman.docs.search({ query })` and `kitman.docs.read({ path })` return the same."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: "Getting Started",
|
|
95
|
+
path: "getting-started",
|
|
96
|
+
level: 1,
|
|
97
|
+
link: "https://kitman.sh/knowledge/docs/getting-started",
|
|
98
|
+
text: `Sign in, connect a forge, bring in repositories, pair your machine and start your first Run.
|
|
99
|
+
|
|
100
|
+
Everything starts in the Kitman web. The one command you run is the one it shows you for your machine.`
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: "Getting Started \u203A Sign in",
|
|
104
|
+
path: "getting-started#sign-in",
|
|
105
|
+
level: 2,
|
|
106
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#sign-in",
|
|
107
|
+
text: `## Sign in
|
|
108
|
+
|
|
109
|
+
On the sign-in page, press **Continue with GitHub** or **Continue with GitLab**. If someone invited your email to a Workspace, you land in it. Otherwise Kitman makes you a personal Workspace named after you, with a first Team, its Task Types and an Inbox.
|
|
110
|
+
|
|
111
|
+
The web then walks you through the steps below. Each one can be skipped. Until every step is done, a **Finish setting up** checklist stays at the top of the dashboard; it reads what exists, so a step you finish anywhere else, in settings or the [CLI](/docs/cli), shows as done.`
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: "Getting Started \u203A Connect a forge",
|
|
115
|
+
path: "getting-started#connect-a-forge",
|
|
116
|
+
level: 2,
|
|
117
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#connect-a-forge",
|
|
118
|
+
text: `## Connect a forge
|
|
119
|
+
|
|
120
|
+
Press **Connect GitHub** to install Kitman's GitHub App on your account or organization, or **Connect GitLab** to authorize Kitman on GitLab.com. Kitman creates the webhooks itself. For GitHub Enterprise Server or self-managed GitLab, use **Other forges**, which opens **Settings \u2192 Repository connections**. For self-managed GitLab, **Create the token on GitLab** opens your instance's token page with the name and scopes filled in, so you create the token and paste it.
|
|
121
|
+
|
|
122
|
+
Skipped, Kitman cannot list your repositories, open ChangeRequests or hear about reviews, so Build has nowhere to deliver.`
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
title: "Getting Started \u203A Choose repositories",
|
|
126
|
+
path: "getting-started#choose-repositories",
|
|
127
|
+
level: 2,
|
|
128
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#choose-repositories",
|
|
129
|
+
text: "## Choose repositories\n\nTick the repositories to bring in. They belong to the Workspace, or to the one Team you pick. Each is bound on its default branch, and the check scripts its `package.json` declares (`typecheck`, `type-check`, `lint`, `test`, `check`) are approved as its verifications. When you pick a Team, the first repository becomes the Team's default. A repository the Workspace has bound already stays where it is.\n\nSkipped, Runs have no repository to work in. You can still create Tasks and run Investigations, which need no repository."
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
title: "Getting Started \u203A Set up your machine",
|
|
133
|
+
path: "getting-started#set-up-your-machine",
|
|
134
|
+
level: 2,
|
|
135
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#set-up-your-machine",
|
|
136
|
+
text: `## Set up your machine
|
|
137
|
+
|
|
138
|
+
Copy the command the web shows and paste it into a terminal on a Linux or macOS machine. It installs Bun, the Kitman CLI and herdr-core, which runs your agents' terminals, where missing, signs the machine in, starts your personal Runner as a user service and syncs the Kitman MCP server into each coding agent it finds. It asks nothing and opens no browser, so it works over SSH too. The command carries a Pairing Code that works once and expires after 10 minutes; if it is refused, the web mints another.
|
|
139
|
+
|
|
140
|
+
The step is done when your Runner's first heartbeat arrives. The web then shows which of Pi, Claude Code and Codex it found logged in, and what the others lack. See the [Runner Operations Guide](/docs/runner-operations#your-machines-runner).
|
|
141
|
+
|
|
142
|
+
Skipped, no Runner of yours is online, so your Runs wait for one.`
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
title: "Getting Started \u203A Invite teammates",
|
|
146
|
+
path: "getting-started#invite-teammates",
|
|
147
|
+
level: 2,
|
|
148
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#invite-teammates",
|
|
149
|
+
text: `## Invite teammates
|
|
150
|
+
|
|
151
|
+
Type a teammate's email. When they sign in with it, they land in your Workspace. You can invite people later under **Settings \u2192 Workspace membership**.`
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
title: "Getting Started \u203A Start your first Run",
|
|
155
|
+
path: "getting-started#start-your-first-run",
|
|
156
|
+
level: 2,
|
|
157
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#start-your-first-run",
|
|
158
|
+
text: `## Start your first Run
|
|
159
|
+
|
|
160
|
+
**Start a Research Run** reads your first repository without changing it, which shows Kitman working without risk. Or type what you want built and press **Start a Build**: Build changes the repository and opens a ChangeRequest. Both need your machine's Runner. See [Handing work to agents](/docs/handing-work-to-agents).`
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
title: "Getting Started \u203A Create work",
|
|
164
|
+
path: "getting-started#create-work",
|
|
165
|
+
level: 2,
|
|
166
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#create-work",
|
|
167
|
+
text: `## Create work
|
|
168
|
+
|
|
169
|
+
Open **Work \u2192 Teams**, pick your Team and press **New task**. A title is enough. Everyone in the Workspace sees every Team and can join any of them. See the [Tasks guide](/docs/task-composition).
|
|
170
|
+
|
|
171
|
+
A Task needs no repository. Name one when the work has to happen in a particular repository; otherwise Build works in its Team's default repository. An Investigation needs no repository at all.
|
|
172
|
+
|
|
173
|
+
Move a Task to **Ready for agents**, or use **Start run** on it, and its Task Type's Loop starts: Build for a Feature or Bug, Research for an Investigation. From a terminal:
|
|
174
|
+
|
|
175
|
+
\`\`\`sh
|
|
176
|
+
kitman run start build "add SSO to the admin app"
|
|
177
|
+
kitman run start build ENG-142
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
Starting from words creates a Task for them in your Team. The Run infers the repository and branch from where you are. Answer its Questions in your Inbox, with \`kitman run wait --until attention\`, or in your harness through MCP, whose \`wait_run\` tool waits until the Run needs you.`
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
title: "Getting Started \u203A Hear back",
|
|
184
|
+
path: "getting-started#hear-back",
|
|
185
|
+
level: 2,
|
|
186
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#hear-back",
|
|
187
|
+
text: `## Hear back
|
|
188
|
+
|
|
189
|
+
Your [Inbox](/docs/inbox) tells you what needs you: a Question waiting on your answer, a Run that failed or is ready for review, a Task assigned to you, and news about the Tasks you follow. Items that ask for an action clear themselves once it is taken. In a terminal:
|
|
190
|
+
|
|
191
|
+
\`\`\`sh
|
|
192
|
+
kitman inbox --unread
|
|
193
|
+
kitman inbox my-teams
|
|
194
|
+
\`\`\`
|
|
195
|
+
|
|
196
|
+
Workspace notification preferences, under **Settings \u2192 Notifications**, switch two groups off: "Decisions that need you" covers Questions, failures and drift, and "Work ready for review" covers finished Runs.`
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
title: "Getting Started \u203A Close a Run",
|
|
200
|
+
path: "getting-started#close-a-run",
|
|
201
|
+
level: 2,
|
|
202
|
+
link: "https://kitman.sh/knowledge/docs/getting-started#close-a-run",
|
|
203
|
+
text: `## Close a Run
|
|
204
|
+
|
|
205
|
+
If a Run failed and you finished the work by hand, or nobody will finish it, close it:
|
|
206
|
+
|
|
207
|
+
\`\`\`sh
|
|
208
|
+
kitman run close <run> --complete --reason "finished by hand in !412"
|
|
209
|
+
kitman run close <run> --abandoned --reason "superseded by ENG-150"
|
|
210
|
+
\`\`\`
|
|
211
|
+
|
|
212
|
+
Closing stops a Run that is still going, along with its Child Runs, and moves it to Finished in My Teams. A closed Run refuses resume, answers and steers, so start a new Run instead. The Run page has the same Close action.`
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
title: "Handing Work to Agents",
|
|
216
|
+
path: "handing-work-to-agents",
|
|
217
|
+
level: 1,
|
|
218
|
+
link: "https://kitman.sh/knowledge/docs/handing-work-to-agents",
|
|
219
|
+
text: `Ready for agents, each Task Type's default Loop, the Research Loop and what to do with a Start item in the Inbox.
|
|
220
|
+
|
|
221
|
+
People create Tasks and hand them to agents. An agent works on a Task through a Run of a Loop, and the Run's progress moves the Task through its Team's workflow.`
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
title: "Handing Work to Agents \u203A Ready for agents",
|
|
225
|
+
path: "handing-work-to-agents#ready-for-agents",
|
|
226
|
+
level: 2,
|
|
227
|
+
link: "https://kitman.sh/knowledge/docs/handing-work-to-agents#ready-for-agents",
|
|
228
|
+
text: `## Ready for agents
|
|
229
|
+
|
|
230
|
+
Moving a Task to a state agents pick up from, such as **Ready for agents**, starts its Task Type's default Loop for it. You become the Run's Delivery Owner: its Questions and its handoff come to you. When an agent or a Triage Rule moved the Task, the Task's assignee is the Delivery Owner, or else its creator.
|
|
231
|
+
|
|
232
|
+
Nothing new starts while the Task already has a Run that has not finished.
|
|
233
|
+
|
|
234
|
+
Any state can hand Tasks to agents. In the Team's settings, the **Workflow** tab has a switch with a robot on each state that turns agent pickup on or off; the same robot marks those states in lists and menus. A Triage Rule can accept a Task straight into such a state, so routine work goes from intake to an agent without waiting on a person.`
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
title: "Handing Work to Agents \u203A What the Run does to the Task",
|
|
238
|
+
path: "handing-work-to-agents#what-the-run-does-to-the-task",
|
|
239
|
+
level: 2,
|
|
240
|
+
link: "https://kitman.sh/knowledge/docs/handing-work-to-agents#what-the-run-does-to-the-task",
|
|
241
|
+
text: `## What the Run does to the Task
|
|
242
|
+
|
|
243
|
+
With the default workflow, the Task follows its Run:
|
|
244
|
+
|
|
245
|
+
- the Run starts: **In Progress**;
|
|
246
|
+
- its ChangeRequest opens: **In Review**;
|
|
247
|
+
- its ChangeRequest merges: **Done**;
|
|
248
|
+
- the Run finishes without a ChangeRequest, as Research does: **In Review**, for a person to look at;
|
|
249
|
+
- the Run is blocked, as a full-auto Build is when findings still stand after its last rebuild: **Blocked**. Its blocker is on the Task's timeline. Move the Task on once you have dealt with it; a new Run moves it to **In Progress**.
|
|
250
|
+
|
|
251
|
+
A ChangeRequest someone opens by hand on a branch named with the Task's key moves the Task too. The Team's Workflow tab changes where each milestone goes. Each Run or ChangeRequest moves the Task once per milestone, and never out of Done, Canceled or Duplicate.
|
|
252
|
+
|
|
253
|
+
The Task's subscribers (its assignee, creator, commenters, people mentioned in it and followers) hear in their Inbox as the Run progresses and its ChangeRequest changes.`
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
title: "Handing Work to Agents \u203A Choosing each Task Type's default Loop",
|
|
257
|
+
path: "handing-work-to-agents#choosing-each-task-types-default-loop",
|
|
258
|
+
level: 2,
|
|
259
|
+
link: "https://kitman.sh/knowledge/docs/handing-work-to-agents#choosing-each-task-types-default-loop",
|
|
260
|
+
text: `## Choosing each Task Type's default Loop
|
|
261
|
+
|
|
262
|
+
Under **Settings \u2192 Task Types**, each Type has a **Default Loop**. Feature, Bug, Refactor, Docs and Migration start with Build, which changes code in a repository. Investigation starts with Research, and Performance starts with Hillclimb. Choose any Loop your Workspace has, including one you deployed, or **No default Loop**.
|
|
263
|
+
|
|
264
|
+
Build needs a repository: the Task's own, else its Team's default, which can be any repository in the Workspace. With neither, it uses the repository the Task's earlier Runs all used, else one the Team owns, else the repository the Team's earlier Runs all used. Runs in more than one repository suggest none, and the launch asks for one. Research and other Loops that need no repository run without one.`
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
title: "Handing Work to Agents \u203A The Research Loop",
|
|
268
|
+
path: "handing-work-to-agents#the-research-loop",
|
|
269
|
+
level: 2,
|
|
270
|
+
link: "https://kitman.sh/knowledge/docs/handing-work-to-agents#the-research-loop",
|
|
271
|
+
text: `## The Research Loop
|
|
272
|
+
|
|
273
|
+
Research answers an Investigation Task's question. A researcher Agent investigates against primary sources, attaches a report to the Run with its citations, and posts the report's summary to the Task's timeline. The Run finishing moves the Task to In Review, so you read the report and decide what to build.`
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
title: "Handing Work to Agents \u203A Waiting on other Tasks",
|
|
277
|
+
path: "handing-work-to-agents#waiting-on-other-tasks",
|
|
278
|
+
level: 2,
|
|
279
|
+
link: "https://kitman.sh/knowledge/docs/handing-work-to-agents#waiting-on-other-tasks",
|
|
280
|
+
text: `## Waiting on other Tasks
|
|
281
|
+
|
|
282
|
+
A Task with an open blocker stays in **Ready for agents** and shows what it is waiting on, such as "Waiting on KIT-158". It starts by itself once its last blocker is done, owned by its assignee, else its creator. If it has neither, it stays there and its Team gets a **Start** item in the Inbox.
|
|
283
|
+
|
|
284
|
+
Only a Task in a completed state counts as done. A finished Run or an open ChangeRequest on a blocker starts nothing, and neither does a canceled blocker: remove its relation to release the Task.
|
|
285
|
+
|
|
286
|
+
To start it now, use **Start run** and choose **Start anyway**, or pass \`--override-blockers\` to \`kitman run start\` or \`kitman task assign\`. That applies to that one start: the relation stays, and the Run records who overrode and which blockers were open. A person, or an agent acting for one, can do this. A Loop's own agents cannot.`
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
title: "Handing Work to Agents \u203A When a Run cannot start",
|
|
290
|
+
path: "handing-work-to-agents#when-a-run-cannot-start",
|
|
291
|
+
level: 2,
|
|
292
|
+
link: "https://kitman.sh/knowledge/docs/handing-work-to-agents#when-a-run-cannot-start",
|
|
293
|
+
text: `## When a Run cannot start
|
|
294
|
+
|
|
295
|
+
When Kitman cannot start a Run for the Task, the move still happens, and the person who moved it gets a **Start** item in their Inbox. It says what is missing: the Task Type has no default Loop, the Loop no longer exists, or the Loop needs something Kitman could not choose, such as a repository.
|
|
296
|
+
|
|
297
|
+
Open the item and use **Start run** in it: pick the Loop, and give what is missing, such as the repository to work in. The item clears itself once a Run starts for the Task, or when the Task leaves the state.`
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
title: "Handing Work to Agents \u203A Starting a Run by hand",
|
|
301
|
+
path: "handing-work-to-agents#starting-a-run-by-hand",
|
|
302
|
+
level: 2,
|
|
303
|
+
link: "https://kitman.sh/knowledge/docs/handing-work-to-agents#starting-a-run-by-hand",
|
|
304
|
+
text: `## Starting a Run by hand
|
|
305
|
+
|
|
306
|
+
**Start run** on a Task starts its Type's default Loop without moving it. See [Starting Runs from a Task](/docs/task-composition#starting-runs-from-a-task).`
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
title: "Inbox",
|
|
310
|
+
path: "inbox",
|
|
311
|
+
level: 1,
|
|
312
|
+
link: "https://kitman.sh/knowledge/docs/inbox",
|
|
313
|
+
text: `What arrives in your Inbox, acting on it in place, and the My Teams view.
|
|
314
|
+
|
|
315
|
+
Kitman opens on your Inbox: the work that needs you, and news about the work you care about. Each item is one Task, Run or Proposal, with every Notification about it, newest first, and what is new since you last looked.`
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
title: "Inbox \u203A What arrives",
|
|
319
|
+
path: "inbox#what-arrives",
|
|
320
|
+
level: 2,
|
|
321
|
+
link: "https://kitman.sh/knowledge/docs/inbox#what-arrives",
|
|
322
|
+
text: `## What arrives
|
|
323
|
+
|
|
324
|
+
You hear when:
|
|
325
|
+
|
|
326
|
+
- a Question waits on your answer, as a Run's Delivery Owner or the assignee of its Task;
|
|
327
|
+
- a Run you own failed, finished with a ChangeRequest ready to review, or waits because no Runner is online;
|
|
328
|
+
- a Run could not start for a Task you moved to a state agents pick up from (see [Handing work to agents](/docs/handing-work-to-agents#when-a-run-cannot-start));
|
|
329
|
+
- a Proposal waits on your decision;
|
|
330
|
+
- a Task is assigned to you, or someone mentions you;
|
|
331
|
+
- a Task you subscribe to gets a comment, changes state, has Run progress, or its ChangeRequest changes.
|
|
332
|
+
|
|
333
|
+
You subscribe to a Task by being its assignee or creator, commenting on it, being mentioned in it, or following it. Nobody is told about their own action.
|
|
334
|
+
|
|
335
|
+
Items that ask for an action (answer, review, retry, decide, start) clear themselves once the action is taken anywhere: in the Inbox, on the Task page, in the CLI or through an agent.`
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
title: "Inbox \u203A Acting in place",
|
|
339
|
+
path: "inbox#acting-in-place",
|
|
340
|
+
level: 2,
|
|
341
|
+
link: "https://kitman.sh/knowledge/docs/inbox#acting-in-place",
|
|
342
|
+
text: `## Acting in place
|
|
343
|
+
|
|
344
|
+
Open an item to act on it without leaving the Inbox: answer the Question, decide the Proposal, retry the Run or start another Loop, open the ChangeRequest, triage the Task, change its state, assignee or priority, or reply.
|
|
345
|
+
|
|
346
|
+
Mark items read or unread, done, or snooze them until later. A new Notification brings a done item back. Unsubscribe from a Task to stop hearing about it.
|
|
347
|
+
|
|
348
|
+
From the keyboard: **J** and **K** move between items, **Enter** opens one and **Esc** closes it, **E** marks it done, **U** read or unread, **H** snoozes, and **Z** undoes the last done or snooze. With a Task open, **C** replies, **S**, **P** and **A** change its state, priority and assignee, and **R** starts a Run. **?** lists them all with the control that does the same.
|
|
349
|
+
|
|
350
|
+
New items arrive live, and the navigation shows how many are unread.`
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
title: "Inbox \u203A My Teams",
|
|
354
|
+
path: "inbox#my-teams",
|
|
355
|
+
level: 2,
|
|
356
|
+
link: "https://kitman.sh/knowledge/docs/inbox#my-teams",
|
|
357
|
+
text: `## My Teams
|
|
358
|
+
|
|
359
|
+
**My Teams** shows what is happening across your Teams, by Task, in four groups: **Needs you**, **Waiting on you**, **Working** and **Finished**. It is a tab of the Inbox. Use it to help where work is stuck.`
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
title: "Inbox \u203A In a terminal",
|
|
363
|
+
path: "inbox#in-a-terminal",
|
|
364
|
+
level: 2,
|
|
365
|
+
link: "https://kitman.sh/knowledge/docs/inbox#in-a-terminal",
|
|
366
|
+
text: `## In a terminal
|
|
367
|
+
|
|
368
|
+
\`\`\`sh
|
|
369
|
+
kitman inbox
|
|
370
|
+
kitman inbox --unread
|
|
371
|
+
kitman inbox done task:<id>
|
|
372
|
+
kitman inbox snooze run:<id> --until 2026-10-16T09:00
|
|
373
|
+
kitman inbox my-teams
|
|
374
|
+
\`\`\``
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
title: "Kitman Web",
|
|
378
|
+
path: "index",
|
|
379
|
+
level: 1,
|
|
380
|
+
link: "https://kitman.sh/knowledge/docs",
|
|
381
|
+
text: `Guides to Tasks, Teams, Triage, the Inbox and the agents that work on Tasks.
|
|
382
|
+
|
|
383
|
+
Kitman Web includes user, agent, and operator guides.
|
|
384
|
+
|
|
385
|
+
- [Getting Started](/docs/getting-started)
|
|
386
|
+
- [Kitman CLI](/docs/cli)
|
|
387
|
+
- [Tasks Guide](/docs/task-composition)
|
|
388
|
+
- [Handing Work to Agents](/docs/handing-work-to-agents)
|
|
389
|
+
- [Triage](/docs/triage)
|
|
390
|
+
- [Inbox](/docs/inbox)
|
|
391
|
+
- [Projects and Saved Views](/docs/projects-and-views)
|
|
392
|
+
- [Kits Guide](/docs/kits)
|
|
393
|
+
- [Loop Operations Guide](/docs/loop-operations)
|
|
394
|
+
- [Runner Operations Guide](/docs/runner-operations)`
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
title: "Kits Guide",
|
|
398
|
+
path: "kits",
|
|
399
|
+
level: 1,
|
|
400
|
+
link: "https://kitman.sh/knowledge/docs/kits",
|
|
401
|
+
text: "Deploying, installing, publishing and syncing Kits.\n\nA Kit is what Kitman runs and what agents get: Loops, Agents and Schedules, plus a setup of skills, plugins, MCP servers and instructions. It is a repository whose `kitman.config.ts` exports `defineKit({ \u2026 })`. Kits change only at their source.\n\nA Kit reaches the Workspace, a Team or one person in one of two ways, and a name is only ever one of them there:\n\n- **Deployed** from its repository with `kitman deploy`, by hand or from CI through a Deploy Binding.\n- **Installed** from npm with `kitman kit add <name>`. An install follows npm's `latest` unless pinned.\n\nA Team's Tasks and Runs get the Kits of its Owner chain, nearest first: the Team's, then the Workspace's, then Kitman's shipped Kits."
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
title: "Kits Guide \u203A Starting a Kit",
|
|
405
|
+
path: "kits#starting-a-kit",
|
|
406
|
+
level: 2,
|
|
407
|
+
link: "https://kitman.sh/knowledge/docs/kits#starting-a-kit",
|
|
408
|
+
text: "## Starting a Kit\n\n```sh\nkitman init --kit acme-kit\n```\n\nThis writes a `defineKit` project with an example Loop, its test and a GitLab pipeline that deploys the default branch. `kitman loop fork <loop>` starts a Kit that spreads a shipped Loop instead."
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
title: "Kits Guide \u203A Publishing to npm",
|
|
412
|
+
path: "kits#publishing-to-npm",
|
|
413
|
+
level: 2,
|
|
414
|
+
link: "https://kitman.sh/knowledge/docs/kits#publishing-to-npm",
|
|
415
|
+
text: '## Publishing to npm\n\nAdd `kitman kit build` to `prepack` in the Kit\'s `package.json`:\n\n```json\n{ "scripts": { "prepack": "kitman kit build" } }\n```\n\n`kitman kit build` writes the bundle, setup archives and declarations into `dist/kit` and names them in `package.json`\'s `kitman` field, so `npm publish` ships the built Kit. There is no Kitman publish command. A package published without the build cannot be added.'
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
title: "Kits Guide \u203A Listing, installing and removing",
|
|
419
|
+
path: "kits#listing-installing-and-removing",
|
|
420
|
+
level: 2,
|
|
421
|
+
link: "https://kitman.sh/knowledge/docs/kits#listing-installing-and-removing",
|
|
422
|
+
text: `## Listing, installing and removing
|
|
423
|
+
|
|
424
|
+
\`\`\`sh
|
|
425
|
+
kitman kit list [--team <team>|--me]
|
|
426
|
+
kitman kit show <name>
|
|
427
|
+
kitman kit add <npm name> [--team <team>|--me]
|
|
428
|
+
kitman kit pin <name> <version>
|
|
429
|
+
kitman kit unpin <name>
|
|
430
|
+
kitman kit remove <name> [--yes]
|
|
431
|
+
\`\`\`
|
|
432
|
+
|
|
433
|
+
\`kitman kit list\` shows each Kit with its version and how it got there: deployed from a repository, or installed from npm. \`kitman kit remove\` removes whichever the name is. A deployed Kit prints what removing it takes away and goes only with \`--yes\`, and needs the rights a deploy does.
|
|
434
|
+
|
|
435
|
+
In the web, Knowledge lists a Team's Kits from its Owner chain, and Settings \u2192 Kits shows each deployed Kit's versions, the records it owns and edits made since.`
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
title: "Kits Guide \u203A The Marketplace",
|
|
439
|
+
path: "kits#the-marketplace",
|
|
440
|
+
level: 2,
|
|
441
|
+
link: "https://kitman.sh/knowledge/docs/kits#the-marketplace",
|
|
442
|
+
text: `## The Marketplace
|
|
443
|
+
|
|
444
|
+
The Marketplace lists references to Kits shared as git and npm packages. Adding one installs an npm Kit, or opens a merge request that extends the configuration repository with it.`
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
title: "Kits Guide \u203A Your machine",
|
|
448
|
+
path: "kits#your-machine",
|
|
449
|
+
level: 2,
|
|
450
|
+
link: "https://kitman.sh/knowledge/docs/kits#your-machine",
|
|
451
|
+
text: "## Your machine\n\n`kitman sync` sets up this machine's Harnesses from your Kits: the Workspace's, your Teams' and your own, with the Kitman MCP server."
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
title: "Loop Operations Guide",
|
|
455
|
+
path: "loop-operations",
|
|
456
|
+
level: 1,
|
|
457
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations",
|
|
458
|
+
text: `Agent guide for Loop catalog, Run inspection, templates, and promotion.
|
|
459
|
+
|
|
460
|
+
Loop is the durable automation primitive. A Loop definition declares triggers, guards, steps, contracts, packages, capabilities, and approval policy. Run is one execution of that definition.
|
|
461
|
+
|
|
462
|
+
Use the Loop catalog to inspect whether a Loop is enabled, what can trigger it, and what capabilities it can use. Use the Run inspector to review step status, attempts, waiting or blocked states, safe output, runner attribution, contracts, and package references.
|
|
463
|
+
|
|
464
|
+
Templates propose reviewed changes through Kitman\u2019s governance queue. Direct Loops are promoted only after approval. Git-backed Loops are promoted through the provider delivery path, where package changes are reviewed, linked, and merged through the configured repository policy.
|
|
465
|
+
|
|
466
|
+
Agents should record implementation evidence, verification, and delivery artifacts in Kitman. Human governance remains explicit for approval, Memory acceptance, and Task completion.`
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
title: "Loop Operations Guide \u203A Intent",
|
|
470
|
+
path: "loop-operations#intent",
|
|
471
|
+
level: 2,
|
|
472
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations#intent",
|
|
473
|
+
text: `## Intent
|
|
474
|
+
|
|
475
|
+
Every Run is held to an Intent, seeded when Kitman admits it:
|
|
476
|
+
|
|
477
|
+
- **Goal:** the launch words, or the Task's title and description.
|
|
478
|
+
- **Done when:** the Task's Acceptance Criteria.
|
|
479
|
+
- **Constraints:** see below.
|
|
480
|
+
|
|
481
|
+
Each agent Step's brief states the Intent. While the Run is going, its Delivery Owner amends it on the Run page or with:
|
|
482
|
+
|
|
483
|
+
\`\`\`sh
|
|
484
|
+
kitman run intent <run> --set-goal "<text>"
|
|
485
|
+
kitman run intent <run> --add-constraint "<text>"
|
|
486
|
+
kitman run intent <run> --remove-constraint <id>
|
|
487
|
+
kitman run intent <run> --corrections off
|
|
488
|
+
\`\`\`
|
|
489
|
+
|
|
490
|
+
Each amendment is a new version with its author, and \`kitman run intent <run>\` lists them all. A constraint a person removed never comes back. A settled or closed Run refuses amendments.`
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
title: "Loop Operations Guide \u203A Constraints",
|
|
494
|
+
path: "loop-operations#constraints",
|
|
495
|
+
level: 2,
|
|
496
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations#constraints",
|
|
497
|
+
text: '## Constraints\n\nA Run\'s constraints come from four places:\n\n- **Launch:** `kitman run start <loop> "<words>" --constraint "<text>"`, repeated for each one.\n- **Parent:** a Child Run inherits its parent\'s current constraints.\n- **Repository:** standing constraints, added with `kitman constraint add "<constraint>"` from a checkout of the repository (or under Settings > Standing constraints) and listed or removed with `kitman constraint list` and `kitman constraint remove <constraint>`. A change applies to the next Run admitted, not to Runs already going.\n- **Plan:** a Task filed from a plan ticket carries each of the plan\'s out-of-scope items as `Out of scope: <item>`.\n\n`rule:protected_paths:<glob>[,<glob>\u2026]` is a rule: Kitman checks it without a model, and it keeps the change out of those paths (`rule:protected_paths:db/released/**`). Any other text is a semantic constraint that the shipped `judge` Agent checks.'
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
title: "Loop Operations Guide \u203A Drift Reports and dismissal",
|
|
501
|
+
path: "loop-operations#drift-reports-and-dismissal",
|
|
502
|
+
level: 2,
|
|
503
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations#drift-reports-and-dismissal",
|
|
504
|
+
text: `## Drift Reports and dismissal
|
|
505
|
+
|
|
506
|
+
Oversight checks rules after each agent Step whose Output Kitman accepts, against the Run's whole change so far. It also has the judge check semantic constraints there. A breach opens a Drift Report that cites paths and lines. A report whose breach is gone is resolved \`verified\`. The Run's Delivery Owner dismisses a report they judge wrong:
|
|
507
|
+
|
|
508
|
+
\`\`\`sh
|
|
509
|
+
kitman run drift <run>
|
|
510
|
+
kitman run drift <run> --dismiss <constraint> --reason "fixtures, not released migrations"
|
|
511
|
+
\`\`\``
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
title: "Loop Operations Guide \u203A Corrections",
|
|
515
|
+
path: "loop-operations#corrections",
|
|
516
|
+
level: 2,
|
|
517
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations#corrections",
|
|
518
|
+
text: "## Corrections\n\nWhen a check finds a breach, Kitman steers the Run with a Correction: a fixed one-line note that names the constraint and the cited places and tells the agent to fix it or say why it cannot. It never carries the judge's words. A constraint gets at most two Corrections per Run. A further breach is escalated: the owner is told once (`drift_unresolved`), and the card stays in Needs you until the report is dismissed or verified. The same happens to a breach on a foreground Run, and to any report still unresolved when the Run completes. Switch Corrections off with `kitman run intent <run> --corrections off`, and every breach then escalates straight away."
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
title: "Loop Operations Guide \u203A Alignment",
|
|
522
|
+
path: "loop-operations#alignment",
|
|
523
|
+
level: 2,
|
|
524
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations#alignment",
|
|
525
|
+
text: "## Alignment\n\nWhen a Run completes, Kitman checks its rules on the last change and runs one final Judgement of the goal, each done-when item and each constraint. The Run's Alignment is one of three values:\n\n- `aligned`: every rule passes, every semantic constraint holds on untruncated evidence, everything is met, and no report is open.\n- `not_aligned`: a `block` report is open or something is not met.\n- `unverified`: anything else.\n\nA top-level Run that is not aligned goes to Needs you and tells its owner once. `kitman run show`, the Run page and its card in My Teams show the Alignment.\n\nThe final Judgement runs after the Run completes, so its Step does not change whether the Run shows as succeeded or partial. Only the Alignment it sets counts. When the Runner running it is full and another Run's work waits for it, the Judgement gives up its slot, is skipped, and the Run's Alignment is `unverified`."
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
title: "Loop Operations Guide \u203A Tokens",
|
|
529
|
+
path: "loop-operations#tokens",
|
|
530
|
+
level: 2,
|
|
531
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations#tokens",
|
|
532
|
+
text: "## Tokens\n\nEach attempt of an agent Step records the input, output and cached tokens its Harness reported in its session: Claude Code, Codex and Pi do. Input counts tokens read fresh or written to the cache; cached counts tokens read from it. Claude Code's subagents write their own session files, and their tokens count with the attempt that ran them. An attempt parked on a Question and resumed adds both parts, and one that ran past its time budget or whose Run was stopped still records what its Harness spent. An attempt whose Harness wrote no usage records that it reported none. `runs.show` and `kitman run show` give the Run's total and each Step's. A Child Run shows its own."
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
title: "Loop Operations Guide \u203A Automatic starts",
|
|
536
|
+
path: "loop-operations#automatic-starts",
|
|
537
|
+
level: 2,
|
|
538
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations#automatic-starts",
|
|
539
|
+
text: `## Automatic starts
|
|
540
|
+
|
|
541
|
+
A Loop's When Clauses start Runs from Events. A Team turns each one on or off on the Loop's page, under Starts when, or from a terminal:
|
|
542
|
+
|
|
543
|
+
\`\`\`sh
|
|
544
|
+
kitman loop show shepherd
|
|
545
|
+
kitman loop when shepherd change_request.pipeline on
|
|
546
|
+
kitman loop when release change_request.ready off
|
|
547
|
+
kitman loop starts
|
|
548
|
+
\`\`\`
|
|
549
|
+
|
|
550
|
+
Two of the software-engineering Kit's starts are off until a Team turns them on:
|
|
551
|
+
|
|
552
|
+
- Shepherd, when the forge fails the pipeline of a ChangeRequest that delivers a Task. It starts one Run for that Task. A repeated delivery starts nothing more, and neither does a failure while a Shepherd still works the branch.
|
|
553
|
+
- Release, once per head, when such a ChangeRequest is approved at that head, by the forge or through Kitman, and its pipeline passed there, while no Run works it. A ChangeRequest a Build lands through Shepherd is merged and released by that Shepherd instead. Release asks before it publishes, unless the Team delivers in full auto. It releases only under a \`merge\` release trigger: under a \`milestone\` or \`project\` trigger each Run it starts ends \`not_due\`, so leave it off there.
|
|
554
|
+
|
|
555
|
+
Turning a start off stops new Runs from it. Runs it already started go on. \`kitman loop starts\` lists what each Event started, or why it started nothing.`
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
title: "Loop Operations Guide \u203A Agents and effort",
|
|
559
|
+
path: "loop-operations#agents-and-effort",
|
|
560
|
+
level: 2,
|
|
561
|
+
link: "https://kitman.sh/knowledge/docs/loop-operations#agents-and-effort",
|
|
562
|
+
text: `## Agents and effort
|
|
563
|
+
|
|
564
|
+
Kitman ships the Agents \`implementer\`, \`reviewer\`, \`planner\`, \`releaser\`, \`investigator\` and \`judge\`. They name no model, so a Step runs on whatever model the Runner's harness is logged in to. A Workspace or Team overrides one, such as its harness, model or effort, by declaring an Agent of the same id that extends it, in a Kit it deploys. Each declaration is a layer over the Agent it extends:
|
|
565
|
+
|
|
566
|
+
\`\`\`ts
|
|
567
|
+
export default defineKit({
|
|
568
|
+
agents: {
|
|
569
|
+
reviewer: {
|
|
570
|
+
extends: 'reviewer',
|
|
571
|
+
instructions: \`## House rules
|
|
572
|
+
Never approve a migration that edits a released one.\`,
|
|
573
|
+
effort: 'high'
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
})
|
|
577
|
+
\`\`\`
|
|
578
|
+
|
|
579
|
+
A declared Agent replaces only the fields it names. Its instructions merge by \`## \` heading:
|
|
580
|
+
|
|
581
|
+
- A section it names replaces the parent's section with that heading.
|
|
582
|
+
- A new heading is appended.
|
|
583
|
+
- Any text before its first heading replaces the parent's.
|
|
584
|
+
|
|
585
|
+
An Agent can list fallbacks for a Runner that does not offer its Harness:
|
|
586
|
+
|
|
587
|
+
\`\`\`ts
|
|
588
|
+
export default defineKit({
|
|
589
|
+
agents: {
|
|
590
|
+
reviewer: {
|
|
591
|
+
extends: 'reviewer',
|
|
592
|
+
harness: 'claude',
|
|
593
|
+
effort: 'high',
|
|
594
|
+
fallbacks: [
|
|
595
|
+
{ harness: 'codex', model: 'gpt-5.5' },
|
|
596
|
+
{ harness: 'pi', effort: 'medium' }
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
})
|
|
601
|
+
\`\`\`
|
|
602
|
+
|
|
603
|
+
A Step launches the first choice the claiming Runner offers, and the Run page's Step view shows the choices it skipped and why. A fallback with no effort runs at the Agent's effort, and one with no model runs on the Harness's own model. An Agent that extends another inherits its fallbacks; naming \`fallbacks\` replaces them, and \`fallbacks: []\` clears them.
|
|
604
|
+
|
|
605
|
+
Effort (\`low\`, \`medium\`, \`high\` or \`xhigh\`) is recorded on each StepAttempt. \`kitman agent list\` shows each Agent merged, with the layer each field came from.`
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
title: "Projects and Saved Views",
|
|
609
|
+
path: "projects-and-views",
|
|
610
|
+
level: 1,
|
|
611
|
+
link: "https://kitman.sh/knowledge/docs/projects-and-views",
|
|
612
|
+
text: "Plan cross-Team work in Projects with Milestones, and save the ways you look at Tasks."
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
title: "Projects and Saved Views \u203A Projects",
|
|
616
|
+
path: "projects-and-views#projects",
|
|
617
|
+
level: 2,
|
|
618
|
+
link: "https://kitman.sh/knowledge/docs/projects-and-views#projects",
|
|
619
|
+
text: `## Projects
|
|
620
|
+
|
|
621
|
+
A Project is a deliverable that spans Teams, such as a launch or a migration. Find them under **Work \u2192 Projects**. Anyone in the Workspace can create, edit or delete one.
|
|
622
|
+
|
|
623
|
+
A Project has a name, a description, a lead, a status (planned, active, paused, completed or canceled) and a target date. Inside it, ordered Milestones mark the stages toward the deliverable, each with an optional target date.
|
|
624
|
+
|
|
625
|
+
Put a Task into a Project, and into one of its Milestones, from the Task's properties. Its progress is worked out from its Tasks' states: completed Tasks over all Tasks, leaving out canceled and duplicate ones. The Project shows it overall, per Milestone and per Team, so nobody updates progress by hand.
|
|
626
|
+
|
|
627
|
+
Deleting a Milestone or a Project takes its Tasks out of it; the Tasks stay.`
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
title: "Projects and Saved Views \u203A When a Project releases",
|
|
631
|
+
path: "projects-and-views#when-a-project-releases",
|
|
632
|
+
level: 3,
|
|
633
|
+
link: "https://kitman.sh/knowledge/docs/projects-and-views#when-a-project-releases",
|
|
634
|
+
text: "### When a Project releases\n\nBy default Release runs after each merge. Under **Settings \u2192 Delivery and releases**, the Workspace sets when Release runs, and a Team can choose its own: on each merge, when a Milestone is done, or when the Project is done. A Project sets its own on its page, under **Release**, and otherwise inherits its Team's. A Shepherd or Release Run can still override it for itself, for example to release a hotfix on merge.\n\nName a Project by its version, such as `0.11.0`. When a Project releases per Milestone, the last Task of each Milestone to finish starts one Release: each Milestone before the last cuts the next release candidate (`0.11.0-rc.1`, `0.11.0-rc.2`, ...), and the Milestone that finishes the Project cuts `0.11.0`. When it releases per Project, one Release cuts `0.11.0` once all its Tasks are done. Canceled and duplicate Tasks do not hold a Milestone or Project open. Merges in between start no Release. The Release Run shows the Milestone or Project that started it and the Tasks it ships, and every Shepherd and Release Run shows the trigger it used and where that came from.\n\nFrom a terminal, `kitman release workspace|team <team>|project <project> [merge|milestone|project|inherit]` reads or sets it; Code Mode's `workspaces.releaseTrigger`, `teams.releaseTrigger` and `projects.releaseTrigger` do the same."
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
title: "Projects and Saved Views \u203A Where a Project's work lands",
|
|
638
|
+
path: "projects-and-views#where-a-projects-work-lands",
|
|
639
|
+
level: 3,
|
|
640
|
+
link: "https://kitman.sh/knowledge/docs/projects-and-views#where-a-projects-work-lands",
|
|
641
|
+
text: "### Where a Project's work lands\n\nBy default every Task's ChangeRequest targets the repository's default branch. Under **Settings \u2192 Delivery and releases**, the Workspace sets where delivery lands, and a Team can choose its own; a Project sets its own on its page, under **Delivery**, and otherwise inherits its Team's. On an epic branch, each sub-task's Build branches from its epic's branch (`feature/KIT-1` by default) on a branch of its own (`feature/KIT-1-KIT-2`), its ChangeRequest targets the epic branch, and Shepherd merges it there and keeps the epic branch up to date with the default branch. Once every sub-task is done, the epic's ChangeRequest to the default branch opens, and Release runs only after it merges. A Build, Review, Shepherd or Release Run can override it for itself with `deliveryTarget: default_branch`, for example to ship a hotfix from a sub-task straight to the default branch. Every such Run shows where it landed and where that came from.\n\nFrom a terminal, `kitman land workspace|team <team>|project <project> [default|epic|inherit]` reads or sets it; Code Mode's `workspaces.deliveryTarget`, `teams.deliveryTarget` and `projects.deliveryTarget` do the same."
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
title: "Projects and Saved Views \u203A Filtering and arranging Tasks",
|
|
645
|
+
path: "projects-and-views#filtering-and-arranging-tasks",
|
|
646
|
+
level: 2,
|
|
647
|
+
link: "https://kitman.sh/knowledge/docs/projects-and-views#filtering-and-arranging-tasks",
|
|
648
|
+
text: `## Filtering and arranging Tasks
|
|
649
|
+
|
|
650
|
+
Every list of Tasks has **Filter**, **Group by** and **Order by** controls. A filter matches all or any of its conditions, and each condition can be negated. Filter on Team, state, state category, assignee (someone, nobody or you), creator, priority, Labels, repository, Project, Milestone, parent, Task Type, text, created and updated dates, and Run status: has an active Run, its latest Run needs a person, or it has no Run.
|
|
651
|
+
|
|
652
|
+
Group by state, Task Type, assignee, priority, repository, Project or Milestone, and order by your manual order, priority, creation, last update or key. **Triage** includes Triage Tasks, which are left out otherwise.
|
|
653
|
+
|
|
654
|
+
Switch between the list and board layouts. A board has a column per Workflow State: drag a card to another column, or use **Move to** on a card from the keyboard. Dragging within a column changes the manual order.`
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
title: "Projects and Saved Views \u203A Saved Views",
|
|
658
|
+
path: "projects-and-views#saved-views",
|
|
659
|
+
level: 2,
|
|
660
|
+
link: "https://kitman.sh/knowledge/docs/projects-and-views#saved-views",
|
|
661
|
+
text: `## Saved Views
|
|
662
|
+
|
|
663
|
+
**Save view** keeps a filter, grouping, ordering and layout under a name. Choose who sees it: only you, your Team, or everyone in the Workspace. Anyone can change a Team or Workspace view; only you can change your own.
|
|
664
|
+
|
|
665
|
+
Find saved views under **Work \u2192 Views**. Open one, change it, and **Update view**, or **Save as new view** to keep both.
|
|
666
|
+
|
|
667
|
+
**My tasks** lists the Tasks assigned to you, created by you, and those you subscribe to.`
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
title: "Runner Operations Guide",
|
|
671
|
+
path: "runner-operations",
|
|
672
|
+
level: 1,
|
|
673
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations",
|
|
674
|
+
text: `Operator guide for runner setup, health, leases, capabilities, and recovery.
|
|
675
|
+
|
|
676
|
+
Runners execute StepAttempts in user-controlled environments. A runner advertises labels, harnesses, config writers, sandbox backends, delivery tools, resource limits, and Loop execution capabilities.`
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
title: "Runner Operations Guide \u203A Your machine's Runner",
|
|
680
|
+
path: "runner-operations#your-machines-runner",
|
|
681
|
+
level: 2,
|
|
682
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#your-machines-runner",
|
|
683
|
+
text: "## Your machine's Runner\n\nPairing a machine (see [Getting Started](/docs/getting-started#set-up-your-machine)) or `kitman init` registers your personal Runner and keeps it running as a user service:\n\n- On Linux, a systemd user unit `kitman-runner-<runner-id>.service`. Check it with `systemctl --user status kitman-runner-<runner-id>`.\n- On macOS, a launchd agent `dev.kitman.kitman-runner-<runner-id>` in `~/Library/LaunchAgents`. Check it with `launchctl print gui/$(id -u)/dev.kitman.kitman-runner-<runner-id>`.\n\n`kitman runner doctor` shows each Runner's service state on this machine. It also shows the delivery the Runner's Team works under, `gated` or `auto` for full auto, and what that makes its provider actions: under `gated`, approve, merge and release are `gated`, for a person to decide. A Runner that serves more than one Team shows `per_team`, for its delivery and for those actions, until `--team` names one; `--team` leaves a Runner owned by one Team on that Team. When Kitman cannot read the Team's delivery, the row shows `unknown` and `deliveryUnknownBecause` says why. Personal Runners run on Linux and macOS, on x86_64 or arm64."
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
title: "Runner Operations Guide \u203A Runner settings",
|
|
687
|
+
path: "runner-operations#runner-settings",
|
|
688
|
+
level: 3,
|
|
689
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#runner-settings",
|
|
690
|
+
text: "### Runner settings\n\nKitman keeps how your Runner behaves, so you change it on the Runner's page in the **Runners** tab, or with `kitman runner settings <runner>`, without touching its service. Its owner, or a Workspace admin, may change it; each change is in its History with who made it, when, and the old and new value (`kitman runner settings history <runner>`).\n\n- **Concurrency**: how many Work Units it runs at once, 1 to 4. It applies a change within about 10 seconds, and work in flight finishes first.\n- **Sandbox**: `srt` (the default), `docker` or `host`. New Steps and checks use a change; a running Step keeps its own.\n- **Docker image**: the image `docker` runs agents in, pinned by digest. It applies when the Runner restarts.\n- **Check hosts**: hosts every check this Runner runs, for any Team, may also reach.\n- **Checks' Docker image** and **checks' registry image**: for a pipeline check's own Docker daemon (below), each pinned by digest. They apply when the Runner restarts.\n\n```sh\nkitman runner settings <runner> --concurrency 2 --check-hosts github.com\n```\n\nThe Runner's page shows where what the Runner applies differs from its settings, and why.\n\nA few things stay on your machine, because they start the Runner or protect it: the Runner's id, the API URL and its credential, `KITMAN_RUNNER_FULL_ACCESS`, and your consent to run agents with no sandbox, `KITMAN_RUNNER_ALLOW_FULL_ACCESS=1`. Kitman cannot give that consent, so nobody who can change the Runner's settings, nor a compromised control plane, can turn off your machine's sandbox: a Runner set to `host` on a machine without it runs its agents in `srt` and shows the `full_access_refused` Runner Problem.\n\nBefore Kitman kept these, they were the environment variables `KITMAN_RUNNER_CONCURRENCY`, `KITMAN_RUNNER_SANDBOX`, `KITMAN_RUNNER_DOCKER_IMAGE`, `KITMAN_RUNNER_CHECK_HOSTS`, `KITMAN_RUNNER_CHECK_DOCKER_IMAGE` and `KITMAN_RUNNER_CHECK_REGISTRY_IMAGE`. The first time a Runner starts on a version with settings, Kitman adopts the values they give, once, for each setting nobody has set yet (a shared Runner's sandbox excepted); after that the Runner ignores them and warns at each start that each one still set is deprecated. Remove them from its service when its settings look right. While `KITMAN_RUNNER_SANDBOX=host` stays set, it counts as your consent to run agents on the host."
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
title: "Runner Operations Guide \u203A The sandbox",
|
|
694
|
+
path: "runner-operations#the-sandbox",
|
|
695
|
+
level: 3,
|
|
696
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#the-sandbox",
|
|
697
|
+
text: "### The sandbox\n\nYour Runner runs each agent Step, and the checks that test its work, in `srt`, an operating-system sandbox. Inside it your home directory is hidden, apart from toolchain installs, the directories on the Runner's `PATH` and the login files of the Step's own Harness, such as Claude Code's `~/.claude.json`, not its sessions or history. Claude Code, Pi and OpenCode Steps get a copy of their login, so neither `~/.claude/.credentials.json` nor anything of `~/.pi` or OpenCode's directories is readable. The agent and its checks get only `PATH`, `HOME`, the user, shell, locale and time zone of the Runner's environment, their own variables and, for the agent, its Harness's own provider keys; nothing else of the Runner's or herdr-core's environment. So the agent, and the code it writes, cannot read your Kitman login, SSH keys, registry tokens, GPG keys, keyrings, browser profiles, other Steps' transcripts or tokens exported in your session. It reaches only Kitman, its model provider, package registries, the repository's git host, the hosts its Agent declares and the network hosts its Team or repository allows (below). The agent reaches Kitman only with the credential of its own Step, through the Step's tools. A machine without what `srt` needs (bubblewrap, socat and ripgrep on Linux, ripgrep on macOS) shows the `sandbox_missing` Runner Problem with what to install. The Runner then runs its agents in `docker` if it can, and stops if it cannot.\n\nA Claude Code Step runs on a copy of your Claude login without its refresh token or your MCP servers' logins, so it never spends the refresh token your own Claude Code sessions use. The Runner watches your login and copies it again as soon as one of them refreshes it, and when a token has under 4 minutes left and nothing has refreshed it, the Runner refreshes it with your own `claude`, which spends no model tokens. A sandboxed agent cannot read `~/.claude/.credentials.json`, but it can read the Step's copy of the access token. On macOS, where Claude Code keeps its login in the Keychain, there is no file to copy, so the Step uses your Keychain login as before; set `CLAUDE_CODE_OAUTH_TOKEN` from `claude setup-token` in the Runner's environment to give its Steps a login of their own. If a Step loses its login anyway, Kitman starts it again from its last checkpoint on a fresh login, up to 3 times, and says why in the Run.\n\n`srt` cannot reach Unix sockets or the host's loopback, so tests that need docker, an SSH agent or a database on your machine cannot run in a Step or a check, apart from the Postgres a repository declares in `.kitman/checks.json` (below). Checks run with `KITMAN_CHECK_SANDBOX` set, so a repository's tests can skip those. A Runner offers no Codex while its agents run in `srt`.\n\nA check reaches Kitman, package registries and the repository's git host. Where a Team's agent Steps and checks need another host, such as a git dependency on `github.com`, allow it to that Team, or to one repository, in **Settings \u2192 Agent boundaries \u2192 Network hosts**, or with the CLI:\n\n```sh\nkitman network-host add github.com --team <team> # or --repo, for the current checkout's repository\nkitman network-host list --team <team>\nkitman network-host remove github.com --team <team>\n```\n\nA host is a name, `name:port` or `*.domain`; only that Team's or repository's Steps and checks reach it, on any Runner, and each change is in the audit log. A member of the Team, or a Workspace owner or admin, may change a Team's hosts or those of a repository the Team owns; a repository the Workspace owns takes an owner or admin. A host never opens the network: only an Agent that declares `network: 'open'` does.\n\nWhere every check one Runner runs needs another host, add it to the Runner's check hosts (see [Runner settings](#runner-settings)). Every check this Runner runs, for any Team, can then reach those hosts. Kitman's own checks need `github.com` there, because its release tests fetch pinned Kit sources from GitHub:\n\n```sh\nkitman runner settings <runner> --check-hosts github.com\n```\n\nA repository whose tests need a Postgres says so in `.kitman/checks.json`:\n\n```json\n{ \"services\": [\"postgres\"] }\n```\n\nThe Runner then starts a fresh PostgreSQL 16 with pgvector for each checkout it verifies, with docker on its host, and gives each check its `POSTGRES_URL`, for a role that is not a superuser. The check reaches that one database and nothing else on your machine: on Linux through the sandbox's proxy, on macOS through a socket the Runner serves for it, and in docker on the check's own network. The Runner needs docker for this. Without it, or when the checks cannot reach the database, the verification fails and says why, rather than letting the tests skip.\n\nA check marked as the repository's pipeline, such as one running `gitlab-ci-local`, gets a rootless Docker daemon of its own, never your machine's: the sandbox still blocks `/var/run/docker.sock`, and the check's `DOCKER_HOST` points at its own daemon. Set the Runner's checks' Docker image to a `docker:*-dind-rootless` image, and its checks' registry image to a `registry:3` image, each pinned by digest, then restart it. The Runner starts that daemon with docker on its host, unprivileged, with none of your files mounted and an empty image store each time, and lets its containers reach only the check's allowed hosts. It pulls Docker Hub's images through a registry mirror whose cache it keeps between checks, in the `kitman-check-registry-cache-<runner>` volume, which no check can push to. Neither your Docker logins nor your `~/.gitlab-ci-local/variables.yml` reach it. Without both settings, a pipeline check's verification fails and says why.\n\nWhen it starts, a Runner whose agents run in `srt` runs each detected Harness's `--version` there, trying each binary of that name on its `PATH` in order, and launches the first that starts. A launcher that writes to your home directory or downloads first, such as a `mise use -g` or `mise x tool@latest` wrapper, cannot start in `srt`, so put the installed binary's directory on the Runner's `PATH` as well. A Harness none of whose binaries start is not offered, and the Runners tab and `kitman runner doctor` say which binaries were tried. Each binary that does not start adds up to 10 seconds to the Runner's start.\n\nTo run agents and checks without a sandbox, set `KITMAN_RUNNER_ALLOW_FULL_ACCESS=1` in the Runner's service on your machine, restart it, and set its sandbox to `host` in its settings. An agent then acts with all your access, and Kitman cannot tell its calls from yours."
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
title: "Runner Operations Guide \u203A herdr-core",
|
|
701
|
+
path: "runner-operations#herdr-core",
|
|
702
|
+
level: 3,
|
|
703
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#herdr-core",
|
|
704
|
+
text: "### herdr-core\n\nYour Runner runs each agent Step in a [herdr-core](https://herdr.dev) terminal, which pairing installs when `herdr-core` is missing. A personal Runner uses your own herdr-core, so `hc ls` lists its agents next to your terminals and `hc attach <terminal>` lets you watch one and type into it; `hc ls --label kitman.runner=<runner-id>` lists only that Runner's. If you run herdr-app, each Run is a space and each Step a tab in it. A shared Runner uses a herdr-core session of its own, so its agents never appear among your terminals.\n\nWhen a Step ends, your Runner stops every process its agent started, including one it detached into a session of its own, such as a test that launched another `claude`. A process it cannot stop shows as the `processes_unreaped` Runner Problem with the command that stops it. Where your Runner cannot hold every process an agent starts, on `host` without a systemd user manager or on srt outside Linux, it shows the `processes_uncontained` Runner Problem and how to fix it.\n\nWhen Kitman serves a stable release newer than your Runner's, your Runner installs it and restarts on it by itself. It first stops claiming and lets its running work finish, for up to 30 minutes, and any Step still running then goes back to Kitman for another Runner. Release candidates and dev builds are never installed this way. A Runner in a container cannot update itself, so it shows the `update_required` Runner Problem with the release to run its image with, and keeps working on its current version.\n\nWhen a Kitman release raises the protocol its Runners speak, Kitman gives an older Runner no more work and shows it with the `update_required` Runner Problem. The Runner installs the release Kitman serves and restarts on it by itself. If the release still reads the older protocol's work calls, the Runner first lets its running work finish, for up to 30 minutes, and any Step still running then goes back to Kitman for another Runner. Otherwise its running Steps stop and go back to Kitman once their leases expire. A Runner in a container cannot update itself: it waits for its work the same way, then stops. Run it from an image with the release Kitman serves.\n\nEvery Runner start updates herdr-core to its latest release within the same protocol generation, keeping your terminals running, so herdr-core follows each Kitman update. An update that cannot happen, such as on a machine that is offline or a herdr-core a package manager installed, leaves the Runner working on the herdr-core it has and shows the `update_failed` Runner Problem with its fix.\n\nA Runner without a herdr-core it can use shows the `herdr_core_missing` Runner Problem and stops:\n\n- herdr-core is not installed: run `curl -fsSL https://releases.herdr.dev/core/install.sh | sh`, then restart the Runner.\n- herdr-core lacks something Kitman needs: run `herdr-core update`, then restart the Runner.\n- herdr-core speaks a newer protocol generation than this Kitman: update Kitman."
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
title: "Runner Operations Guide \u203A Harnesses",
|
|
708
|
+
path: "runner-operations#harnesses",
|
|
709
|
+
level: 3,
|
|
710
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#harnesses",
|
|
711
|
+
text: "### Harnesses\n\nWhen it starts, the Runner offers each of Pi, Claude Code and Codex that is installed and logged in:\n\n| Harness | Installed when | Logged in when |\n| ----------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| Pi | `pi` is on `PATH` | `~/.pi/agent/auth.json` exists, or `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY` or `OPENROUTER_API_KEY` is set |\n| Claude Code | `claude` is on `PATH` | `~/.claude/.credentials.json` exists, `~/.claude.json` records an `oauthAccount`, or `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN` is set |\n| Codex | `codex` is on `PATH` | `~/.codex/auth.json` exists, or `OPENAI_API_KEY` or `CODEX_API_KEY` is set |\n\nFor each Harness it does not offer, the Runner reports what is missing, and the Runners tab under **Agents** and `kitman runner doctor` show it. After you install or log in to a Harness, restart the Runner's service so it is detected. OpenCode is never detected; an Agent that names it still launches it on a Runner that offers it."
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
title: "Runner Operations Guide \u203A Default Harness",
|
|
715
|
+
path: "runner-operations#default-harness",
|
|
716
|
+
level: 3,
|
|
717
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#default-harness",
|
|
718
|
+
text: "### Default Harness\n\nA Pi Step does not load the skills, extensions, MCP servers or `AGENTS.md` in `~/.pi/agent`, or a repository's `.pi` files: it uses your Pi login, a copy of your model lists, your default model, per-model thinking levels and `httpProxy`, and the Kit setup of its Run. A Step in the `docker` sandbox gets none of your Pi files, only the Kit setup. A `host` or `srt` Step can read that `httpProxy` in its copy, and a `host` Step can read `~/.pi/agent/settings.json` itself, so do not put a password there that the agent should not have.\n\nThe Step's copy of your login has no OAuth refresh tokens and a sandboxed agent cannot read `~/.pi/agent/auth.json`. Before each attempt, and every minute while it runs, the Runner refreshes any token with under 15 minutes left, using your own `pi` under its usual lock, and updates the Step's copy, so a Step can run longer than its token lasts. A sandboxed agent cannot write that copy. A token that lasts under 15 minutes is renewed every minute. If a renewal fails, the Runner logs `harness_login_near_expiry` with the login's provider and tries again a minute later. A Step can fail once its token has under 5 minutes left, because Pi then tries to renew the Step's copy itself and cannot, so the token may not have expired yet when you look. That leaves the Runner about 10 minutes to renew it, and a token that lasts under 5 minutes cannot run a Step at all. If your login was revoked, log in again with `pi`, then retry the Step.\n\nThe Runner renews every OAuth login in `~/.pi/agent/auth.json`, not only the one a Step uses, so the warning can name a login that Step does not need. Once a token has expired, each Step tries it less often, down to once an hour. Remove a login you no longer use with `/logout` in `pi`.\n\nA Pi agent can write its own session file, so the Runner limits what it takes from one. The Transcript leaves out a session line of 8 MiB or more, and the Runner logs `runner_transcript_line_passed_over` the first time. A tool call shows up to 200,000 characters of its arguments, and a longer value in them shows as a note of its length. The Runner stops reading a session while 16 MiB of its Transcript is unsent, and reads on once Kitman takes it. A session that gzips to more than 32 MiB, well above real ones, keeps its last checkpoint, and the Runner logs `runner_session_unread`.\n\nAn Agent that names no Harness, which includes the shipped ones, runs on the claiming Runner's default Harness. The default is the one chosen for the Runner, else the first of Pi, Claude Code and Codex the Runner offers. Choose it under **Agents \u2192 Runners** with **Default Harness**: the owner chooses for a personal Runner, a Workspace admin for any other. An Agent that names a Harness runs only on Runners that offer it."
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
title: "Runner Operations Guide \u203A Scope and scheduling boundaries",
|
|
722
|
+
path: "runner-operations#scope-and-scheduling-boundaries",
|
|
723
|
+
level: 2,
|
|
724
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#scope-and-scheduling-boundaries",
|
|
725
|
+
text: `## Scope and scheduling boundaries
|
|
726
|
+
|
|
727
|
+
Every runner has one normalized ownership shape: workspace-wide (\`all\` Teams), workspace-selected (only its explicit Team grants), Team-owned, or personal (one owner user). The runner's effective Team access is only an access filter. It never creates AgentIdentity authority, capabilities, or a lease.
|
|
728
|
+
|
|
729
|
+
People reach Teams through Workspace membership: every member of a Workspace can see its Teams and start Runs in them. A Runner's Team access decides only which Runs it may serve.
|
|
730
|
+
|
|
731
|
+
A Run without a Team can be served only by a Runner that serves the whole Workspace, or by its requester's personal Runner. A Runner limited to selected Teams, or owned by one Team, never takes it. When no such Runner is online, the Run's Delivery Owner hears in their Inbox that it is waiting for one.
|
|
732
|
+
|
|
733
|
+
Workspace operators may register, re-scope, and manage selected-Team grants. Personal foreground execution is owner-only: the owner selects one personal runner and the server snapshots the exact target. Administrators can manage runner health and lifecycle without receiving workload or interactive-session access.`
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
title: "Runner Operations Guide \u203A Your Runner in another Workspace",
|
|
737
|
+
path: "runner-operations#your-runner-in-another-workspace",
|
|
738
|
+
level: 3,
|
|
739
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#your-runner-in-another-workspace",
|
|
740
|
+
text: `### Your Runner in another Workspace
|
|
741
|
+
|
|
742
|
+
Your personal Runner belongs to the Workspace you paired it in. To use the same machine for your work in another Workspace you are a member of, attach it there:
|
|
743
|
+
|
|
744
|
+
\`\`\`sh
|
|
745
|
+
kitman runner attach <workspace-id> --runner <runner-id>
|
|
746
|
+
kitman runner attachments --runner <runner-id>
|
|
747
|
+
kitman runner detach <workspace-id> --runner <runner-id>
|
|
748
|
+
\`\`\`
|
|
749
|
+
|
|
750
|
+
Run these from the Runner's own Workspace. Only you can attach your Runner; you or an admin of its own Workspace can detach it. It stays one Runner, with its identity, Team access and slots: in an attached Workspace it serves only the Runs you start there, in no Team or a Team you can read, and its slots are shared across every Workspace it serves. Another member's Runs there never run on it. Once you detach it, leave that Workspace or remove the Runner, it takes no more work there, and the work it holds there goes back on offer for another Runner.
|
|
751
|
+
|
|
752
|
+
Team members do not need the operator inventory to choose their own foreground runner. The owner-scoped foreground-candidate read returns only personal runners owned by the authenticated human/delegating actor whose bound AgentIdentity is active in that Team's Workspace; admission still revalidates every gate.
|
|
753
|
+
|
|
754
|
+
Use the Runners page to answer why a Step is not being picked up. Start with the Runner's state (online, offline since its last heartbeat, or needs attention with its Runner Problems), visible leases, expired leases, capability compatibility, sandbox backend availability, and recent failure diagnostics.
|
|
755
|
+
|
|
756
|
+
Recovery should match the failed gate. Fix a Runner's open Runner Problems before retrying work, release or wait out expired leases, update missing capabilities or labels, and keep sandbox policy fail-closed when requirements are unavailable.
|
|
757
|
+
|
|
758
|
+
Foreground work never silently enters the background pool. Offline, busy, unhealthy, drained, or stale personal runners leave the Run waiting with \`waiting_for_personal_runner\`. The owner may explicitly convert waiting work to background only after the server rechecks eligibility and confirms that no lease is active; the conversion is audited and idempotent.
|
|
759
|
+
|
|
760
|
+
Browser state should expose summaries and safe diagnostics only. Do not surface secrets, raw logs, private credentials, or source snapshots in operator views.
|
|
761
|
+
|
|
762
|
+
An owner may see a bounded Herdr interaction status/reference for a foreground run. Runner-management views show health, ownership, effective Team access, and safe diagnostics only; they never show herdr-core sessions, terminal identifiers, transcripts, terminal output, worktree paths, or connection details.`
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
title: "Runner Operations Guide \u203A Flight deck admission evidence",
|
|
766
|
+
path: "runner-operations#flight-deck-admission-evidence",
|
|
767
|
+
level: 2,
|
|
768
|
+
link: "https://kitman.sh/knowledge/docs/runner-operations#flight-deck-admission-evidence",
|
|
769
|
+
text: `## Flight deck admission evidence
|
|
770
|
+
|
|
771
|
+
The Flight Deck separates runner **readiness** from WorkUnit **claimability**. A healthy heartbeat or accepting replica is not enough to claim work: the runner also needs a current signed profile, artifact/certification evidence, canonical preflight acceptance, environment snapshot, and current lease fence.
|
|
772
|
+
|
|
773
|
+
Environment diagnostics show the selected backend posture, materialization mode, cache hit/miss evidence, and safe blocker codes without exposing checkout paths or command output. Quota evidence is authoritative only when it is fresh and provider-backed; unknown or stale quota is never rendered as available. Cleanup remains unknown or blocked until the runner can account for owned resources.
|
|
774
|
+
|
|
775
|
+
Enrollment, key rotation, revocation, drain, update, and rollback controls show their safe lifecycle posture and disabled reason. Updates and rollbacks must use exact certified digests and new fenced replicas; existing run snapshots are never changed in place.`
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
title: "Tasks Guide",
|
|
779
|
+
path: "task-composition",
|
|
780
|
+
level: 1,
|
|
781
|
+
link: "https://kitman.sh/knowledge/docs/task-composition",
|
|
782
|
+
text: `Teams, keys, Workflow States, Task Types, Labels, relations, sub-tasks, moving Tasks and starting Runs.
|
|
783
|
+
|
|
784
|
+
A Task is a piece of work. Kitman is where Tasks live: people create, shape and plan them here, and agents work on them through Runs.`
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
title: "Tasks Guide \u203A Teams and keys",
|
|
788
|
+
path: "task-composition#teams-and-keys",
|
|
789
|
+
level: 2,
|
|
790
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#teams-and-keys",
|
|
791
|
+
text: "## Teams and keys\n\nEvery Task belongs to exactly one Team. A Team has a key, such as `ENG`, and its Tasks are numbered within it: `ENG-1`, `ENG-2`. Everyone in the Workspace can see and change every Team and every Task. Anyone can create a Team, join or leave one, and add a colleague to one.\n\nA new Workspace starts with a first Team named after it, so you can create a Task straight away. Find every Team under **Work \u2192 Teams**, with its key and member count.\n\nRenaming a Team's key gives its Tasks new keys. Every key a Task has had keeps working, in links, branch names and ChangeRequests."
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
title: "Tasks Guide \u203A Workflow States",
|
|
795
|
+
path: "task-composition#workflow-states",
|
|
796
|
+
level: 2,
|
|
797
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#workflow-states",
|
|
798
|
+
text: `## Workflow States
|
|
799
|
+
|
|
800
|
+
Each Team has its own ordered Workflow States, each in one of these categories: triage, backlog, unstarted, started, completed, canceled and duplicate. A new Team starts with Triage, Backlog, Todo, Ready for agents, In Progress, In Review, Blocked, Done, Canceled and Duplicate, and new Tasks land in Backlog.
|
|
801
|
+
|
|
802
|
+
In the Team's settings, the **Workflow** tab adds, renames, recolours, reorders and removes states. Removing a state asks where its Tasks go. The same tab picks the default state for new Tasks, the states agents pick work up from (see [Handing work to agents](/docs/handing-work-to-agents)), and where milestones move Tasks: a Run starting, finishing, failing or being blocked, and a ChangeRequest opening or merging. A Task in Done, Canceled or Duplicate is never moved back by a milestone.
|
|
803
|
+
|
|
804
|
+
A Team view has three tabs: Active shows unstarted and started Tasks, Backlog the backlog, and All every Task outside Triage, including completed and canceled ones.`
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
title: "Tasks Guide \u203A Creating and editing Tasks",
|
|
808
|
+
path: "task-composition#creating-and-editing-tasks",
|
|
809
|
+
level: 2,
|
|
810
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#creating-and-editing-tasks",
|
|
811
|
+
text: `## Creating and editing Tasks
|
|
812
|
+
|
|
813
|
+
Press **C** or use **New task** in a Team view. A title is enough; everything else is optional. Keep the form open to capture several Tasks in a row. Filing a Task in a Team you are not a member of sends it to that Team's [Triage](/docs/triage).
|
|
814
|
+
|
|
815
|
+
Open a Task beside its list, or on its own page. The description is markdown and saves as you type. If someone else changes it while you edit, Kitman tells you instead of overwriting their work. Acceptance Criteria are an ordered list that reviews and Runs hold the work to.
|
|
816
|
+
|
|
817
|
+
Change a Task's state, priority, assignee, Labels, repository and Task Type from the list, the board or the Task page. From the keyboard: **S** state, **P** priority, **A** assignee, **L** Labels, **T** Task Type, **M** move to another Team, **R** start a Run, **X** select. **?** lists every shortcut with the control that does the same.
|
|
818
|
+
|
|
819
|
+
Select several Tasks to change their state, priority, Task Type, assignee, Labels, repository or Team in one action.
|
|
820
|
+
|
|
821
|
+
The timeline shows comments, every change and Run milestones together, each saying who made it: a person, a Triage Rule, triage duty or a Run. Mention a colleague in a comment or description to tell them.`
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
title: "Tasks Guide \u203A Repositories",
|
|
825
|
+
path: "task-composition#repositories",
|
|
826
|
+
level: 2,
|
|
827
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#repositories",
|
|
828
|
+
text: `## Repositories
|
|
829
|
+
|
|
830
|
+
A Task may name any repository in the Workspace, or none. A repository matters when work has to happen in it: a Run that changes code works in the Task's repository, else in its Team's default repository, else in the one repository the Task's or Team's earlier Runs used.`
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
title: "Tasks Guide \u203A Task Types",
|
|
834
|
+
path: "task-composition#task-types",
|
|
835
|
+
level: 2,
|
|
836
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#task-types",
|
|
837
|
+
text: `## Task Types
|
|
838
|
+
|
|
839
|
+
Every Task has a Task Type. A Workspace starts with Feature (the default), Bug, Refactor, Docs, Migration and Investigation. Each Type has an optional Outcome and an optional default Loop: Build for code changes, and Research for Investigations.
|
|
840
|
+
|
|
841
|
+
Under **Settings \u2192 Task Types**, anyone can add, rename, recolour or remove a Type, and choose its Outcome and default Loop. Removing a Type asks which Type its Tasks get instead.`
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
title: "Tasks Guide \u203A Labels and priority",
|
|
845
|
+
path: "task-composition#labels-and-priority",
|
|
846
|
+
level: 2,
|
|
847
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#labels-and-priority",
|
|
848
|
+
text: `## Labels and priority
|
|
849
|
+
|
|
850
|
+
Labels are shared by every Team. Anyone can create, rename, recolour or delete one under **Settings \u2192 Labels**, and deleting a Label removes it from its Tasks.
|
|
851
|
+
|
|
852
|
+
Priority is urgent, high, medium, low or none. Tasks without a priority sort last.`
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
title: "Tasks Guide \u203A Relations and sub-tasks",
|
|
856
|
+
path: "task-composition#relations-and-sub-tasks",
|
|
857
|
+
level: 2,
|
|
858
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#relations-and-sub-tasks",
|
|
859
|
+
text: `## Relations and sub-tasks
|
|
860
|
+
|
|
861
|
+
A Task can block another, relate to another, or duplicate another, in any Team. Kitman refuses a blocks relation that would form a cycle. Blocks relations are the build order agents follow.
|
|
862
|
+
|
|
863
|
+
Break a Task into sub-tasks, in its own Team or others. The parent shows each sub-task's state and how many are done.`
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
title: "Tasks Guide \u203A Moving a Task to another Team",
|
|
867
|
+
path: "task-composition#moving-a-task-to-another-team",
|
|
868
|
+
level: 2,
|
|
869
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#moving-a-task-to-another-team",
|
|
870
|
+
text: `## Moving a Task to another Team
|
|
871
|
+
|
|
872
|
+
**Move to** (or **M**) shows the Task's new key and state before you confirm. The Task gets the next number in the new Team and the first state there of the same category. If you are not a member of that Team and it has Triage on, the Task goes to its Triage instead. Labels, repository, assignee, priority, relations, Project and sub-tasks stay. The old key keeps resolving.`
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
title: "Tasks Guide \u203A Starting Runs from a Task",
|
|
876
|
+
path: "task-composition#starting-runs-from-a-task",
|
|
877
|
+
level: 2,
|
|
878
|
+
link: "https://kitman.sh/knowledge/docs/task-composition#starting-runs-from-a-task",
|
|
879
|
+
text: `## Starting Runs from a Task
|
|
880
|
+
|
|
881
|
+
**Start run** on the Task page, the Task pane or a list row starts the Task's Type's default Loop for it. Any other Loop is one click away in its menu. The Task page shows the current Run's live status, any Question waiting on you, earlier Runs, and links to evidence and the ChangeRequest.
|
|
882
|
+
|
|
883
|
+
From a terminal, \`kitman run start <loop> <task key>\` does the same, and \`kitman run start <loop> "<words>"\` creates a Task from the words in your Team and starts the Loop on it.
|
|
884
|
+
|
|
885
|
+
Copy a Task's branch name to name your branch: a ChangeRequest opened from it is linked to the Task and moves it through the workflow.`
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
title: "Triage",
|
|
889
|
+
path: "triage",
|
|
890
|
+
level: 1,
|
|
891
|
+
link: "https://kitman.sh/knowledge/docs/triage",
|
|
892
|
+
text: `How work reaches a Team's Triage, the actions on it, triage duty and Triage Rules.
|
|
893
|
+
|
|
894
|
+
Triage is where a Team reviews work before it joins the Team's workflow. Turn it on or off in the Team's settings, on the **Triage** tab. It is on for a new Team.`
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
title: "Triage \u203A What lands in Triage",
|
|
898
|
+
path: "triage#what-lands-in-triage",
|
|
899
|
+
level: 2,
|
|
900
|
+
link: "https://kitman.sh/knowledge/docs/triage#what-lands-in-triage",
|
|
901
|
+
text: `## What lands in Triage
|
|
902
|
+
|
|
903
|
+
With Triage on, a new Task goes to the Team's Triage when:
|
|
904
|
+
|
|
905
|
+
- its creator is not a member of the Team;
|
|
906
|
+
- an Event made it, or a Run nobody started by hand;
|
|
907
|
+
- someone created it from the Triage view;
|
|
908
|
+
- someone who is not a member moves it in from another Team.
|
|
909
|
+
|
|
910
|
+
Every other Task goes to the state its creator chose, or the Team's default state. A Task in Triage shows why it is there. Team views leave Triage Tasks out unless a view asks for them, and the navigation shows how many are waiting.`
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
title: "Triage \u203A Working the queue",
|
|
914
|
+
path: "triage#working-the-queue",
|
|
915
|
+
level: 2,
|
|
916
|
+
link: "https://kitman.sh/knowledge/docs/triage#working-the-queue",
|
|
917
|
+
text: `## Working the queue
|
|
918
|
+
|
|
919
|
+
**Work \u2192 Triage** lists each Team's Triage Tasks, oldest first, with the open Task's content beside the list. For each Task:
|
|
920
|
+
|
|
921
|
+
- **Accept** (**1**) takes it into the Team's default state, or a state you choose.
|
|
922
|
+
- **Decline** (**2**) cancels it, with a reason its creator can read.
|
|
923
|
+
- **Duplicate** (**3**) marks it a duplicate of a Task you search for.
|
|
924
|
+
- **Snooze** (**H**) hides it until a time. New activity on it brings it back early.
|
|
925
|
+
- **Move** (**M**) hands it to the Team that should own it.
|
|
926
|
+
|
|
927
|
+
**J** and **K** go to the next and previous Task, and focus moves on to the next Task after each decision. **Z** undoes the last accept, decline or snooze. Every shortcut has a visible button.`
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
title: "Triage \u203A Triage duty",
|
|
931
|
+
path: "triage#triage-duty",
|
|
932
|
+
level: 2,
|
|
933
|
+
link: "https://kitman.sh/knowledge/docs/triage#triage-duty",
|
|
934
|
+
text: `## Triage duty
|
|
935
|
+
|
|
936
|
+
On the **Triage** tab, choose the members who share triage duty and their order. A Task that enters Triage with nobody assigned goes to the member whose turn it is, and the turn passes down the list. The Triage view shows who is next. A member who leaves the Team leaves the rotation.`
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
title: "Triage \u203A Triage Rules",
|
|
940
|
+
path: "triage#triage-rules",
|
|
941
|
+
level: 2,
|
|
942
|
+
link: "https://kitman.sh/knowledge/docs/triage#triage-rules",
|
|
943
|
+
text: `## Triage Rules
|
|
944
|
+
|
|
945
|
+
Triage Rules sort incoming work before triage duty assigns it. A rule matches when all, or any, of its conditions hold:
|
|
946
|
+
|
|
947
|
+
- the creator is one of some people;
|
|
948
|
+
- the creator is, or is not, a member of the Team;
|
|
949
|
+
- how the Task was made: by hand, from a plan, from a launch, by an Event, or migrated;
|
|
950
|
+
- it has any or all of some Labels;
|
|
951
|
+
- its priority is one of some priorities;
|
|
952
|
+
- its repository is one of some repositories, or none;
|
|
953
|
+
- its title or description contains some text, ignoring case.
|
|
954
|
+
|
|
955
|
+
Each condition can be negated. A matching rule can set the Team, Task Type, assignee or repository, add Labels, set the priority, or accept the Task into a state, including one agents pick up from.
|
|
956
|
+
|
|
957
|
+
Rules run in order on each Task entering Triage, and turn on and off one by one. A rule that moves the Task to another Team hands it to that Team's rules next; no Team's rules run twice for one Task. The Task's timeline names the rule behind each change.
|
|
958
|
+
|
|
959
|
+
A rule that cannot apply, such as one naming a Label that was deleted, is skipped whole.`
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
path: "sdk/loop/config#AgentInstructions",
|
|
963
|
+
title: "@kitman-sh/sdk/loop \u203A AgentInstructions",
|
|
964
|
+
level: 2,
|
|
965
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/config.d.ts",
|
|
966
|
+
text: "```ts\n/** Agent instructions inline, or a Markdown file in the Kit's repository, read at build. */\nexport type AgentInstructions = string | { readonly file: string }\n```"
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
path: "sdk/loop/config#AgentConfig",
|
|
970
|
+
title: "@kitman-sh/sdk/loop \u203A AgentConfig",
|
|
971
|
+
level: 2,
|
|
972
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/config.d.ts",
|
|
973
|
+
text: `\`\`\`ts
|
|
974
|
+
export type AgentConfig = {
|
|
975
|
+
/** The Agent this one extends. */
|
|
976
|
+
readonly extends?: string
|
|
977
|
+
readonly instructions?: AgentInstructions
|
|
978
|
+
readonly harness?: string
|
|
979
|
+
readonly model?: string
|
|
980
|
+
/** How hard its harness thinks; a harness without the control ignores it. */
|
|
981
|
+
readonly effort?: 'low' | 'medium' | 'high' | 'xhigh'
|
|
982
|
+
/**
|
|
983
|
+
* Harnesses to launch on, in order, when a Runner does not offer this one. A fallback with no effort uses this
|
|
984
|
+
* Agent's; one with no model uses the Harness's own, not this Agent's.
|
|
985
|
+
*/
|
|
986
|
+
readonly fallbacks?: readonly {
|
|
987
|
+
readonly harness: string
|
|
988
|
+
readonly model?: string
|
|
989
|
+
readonly effort?: 'low' | 'medium' | 'high' | 'xhigh'
|
|
990
|
+
}[]
|
|
991
|
+
/** Tools its Steps get beyond the base ones; a list replaces an inherited one and \`[]\` clears it. */
|
|
992
|
+
readonly tools?: readonly ('web' | 'subagents' | 'artifacts' | 'browser')[]
|
|
993
|
+
/** The skills its Steps list; the Run's other Kit skills are loaded by name. A list replaces, \`[]\` clears. */
|
|
994
|
+
readonly skills?: readonly string[]
|
|
995
|
+
/** Hosts its sandboxed Steps may reach beyond the defaults, or \`open\` for an Agent that browses. */
|
|
996
|
+
readonly network?: { readonly hosts: readonly string[] } | 'open'
|
|
997
|
+
/** Runs its Steps only on Runners that run agents in docker, for services or a team image. */
|
|
998
|
+
readonly sandbox?: 'docker'
|
|
999
|
+
}
|
|
1000
|
+
\`\`\``
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
path: "sdk/loop/config#KitSetupConfig",
|
|
1004
|
+
title: "@kitman-sh/sdk/loop \u203A KitSetupConfig",
|
|
1005
|
+
level: 2,
|
|
1006
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/config.d.ts",
|
|
1007
|
+
text: "```ts\n/**\n * What the Kit's agents get. Each skill and plugin comes from a local path in the Kit, a git repository or an npm\n * package, and `instructions` is a Markdown file in the Kit; the build copies them all in.\n */\nexport type KitSetupConfig = KitSetup\n```"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
path: "sdk/loop/config#KitLoop",
|
|
1011
|
+
title: "@kitman-sh/sdk/loop \u203A KitLoop",
|
|
1012
|
+
level: 2,
|
|
1013
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/config.d.ts",
|
|
1014
|
+
text: "```ts\nexport type KitLoop = LoopDefinition<unknown, unknown, unknown>\n```"
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
path: "sdk/loop/config#KitConfig",
|
|
1018
|
+
title: "@kitman-sh/sdk/loop \u203A KitConfig",
|
|
1019
|
+
level: 2,
|
|
1020
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/config.d.ts",
|
|
1021
|
+
text: `\`\`\`ts
|
|
1022
|
+
/** A Kit's \`kitman.config.ts\` default export. */
|
|
1023
|
+
export type KitConfig = {
|
|
1024
|
+
readonly loops: readonly KitLoop[]
|
|
1025
|
+
readonly agents?: { readonly [id: string]: AgentConfig }
|
|
1026
|
+
readonly schedules?: { readonly [key: string]: ScheduleDeclaration }
|
|
1027
|
+
readonly setup?: KitSetupConfig
|
|
1028
|
+
readonly extends?: readonly KitConfig[]
|
|
1029
|
+
}
|
|
1030
|
+
\`\`\``
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
path: "sdk/loop/config#defineKit",
|
|
1034
|
+
title: "@kitman-sh/sdk/loop \u203A defineKit",
|
|
1035
|
+
level: 2,
|
|
1036
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/config.d.ts",
|
|
1037
|
+
text: `\`\`\`ts
|
|
1038
|
+
/** Declares a Kit: its Loops, its Agents keyed by id, the setup its agents get, and the Kits it extends. */
|
|
1039
|
+
export const defineKit = <const L extends readonly unknown[] = []>(config: {
|
|
1040
|
+
readonly loops?: L & Loops<L>
|
|
1041
|
+
readonly agents?: { readonly [id: string]: AgentConfig }
|
|
1042
|
+
/** Recurring starts of a Loop, keyed; only the Kit a repository deploys may declare them. */
|
|
1043
|
+
readonly schedules?: { readonly [key: string]: ScheduleDeclaration }
|
|
1044
|
+
readonly setup?: KitSetupConfig
|
|
1045
|
+
/**
|
|
1046
|
+
* Imported Kits this one builds in, like Nuxt layers: this Kit's entries replace theirs by name, and an earlier
|
|
1047
|
+
* entry's replace a later one's.
|
|
1048
|
+
*/
|
|
1049
|
+
readonly extends?: readonly KitConfig[]
|
|
1050
|
+
}): KitConfig =>
|
|
1051
|
+
// SAFETY: each Loop only ever receives values its own schemas decoded, so its type arguments can be erased.
|
|
1052
|
+
({ ...config, loops: config.loops ?? [] }) as KitConfig
|
|
1053
|
+
\`\`\``
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
path: "sdk/loop/define#LoopCapability",
|
|
1057
|
+
title: "@kitman-sh/sdk/loop \u203A LoopCapability",
|
|
1058
|
+
level: 2,
|
|
1059
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1060
|
+
text: "```ts\n/** What a Loop's program may ask Kitman for; the control plane checks each request against them. */\nexport type LoopCapability = (typeof LoopCapabilities)[number]\n```"
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
path: "sdk/loop/define#LoopOutcome",
|
|
1064
|
+
title: "@kitman-sh/sdk/loop \u203A LoopOutcome",
|
|
1065
|
+
level: 2,
|
|
1066
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1067
|
+
text: `\`\`\`ts
|
|
1068
|
+
export const LoopOutcome = Schema.Literals([
|
|
1069
|
+
'feature',
|
|
1070
|
+
'bug',
|
|
1071
|
+
'refactor',
|
|
1072
|
+
'investigation',
|
|
1073
|
+
'docs',
|
|
1074
|
+
'migration',
|
|
1075
|
+
'performance'
|
|
1076
|
+
])
|
|
1077
|
+
\`\`\`
|
|
1078
|
+
|
|
1079
|
+
\`\`\`ts
|
|
1080
|
+
export type LoopOutcome = typeof LoopOutcome.Type
|
|
1081
|
+
\`\`\``
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
path: "sdk/loop/define#LoopCheckout",
|
|
1085
|
+
title: "@kitman-sh/sdk/loop \u203A LoopCheckout",
|
|
1086
|
+
level: 2,
|
|
1087
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1088
|
+
text: "```ts\nexport type LoopCheckout = 'none' | 'read' | 'write'\n```"
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
path: "sdk/loop/define#EventFilter",
|
|
1092
|
+
title: "@kitman-sh/sdk/loop \u203A EventFilter",
|
|
1093
|
+
level: 2,
|
|
1094
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1095
|
+
text: "```ts\n/** Matched by the control plane against Event payload paths: a value, or any of several. */\nexport type EventFilter = { readonly [path: string]: EventFilterValue | readonly EventFilterValue[] }\n```"
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
path: "sdk/loop/define#WhenClause",
|
|
1099
|
+
title: "@kitman-sh/sdk/loop \u203A WhenClause",
|
|
1100
|
+
level: 2,
|
|
1101
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1102
|
+
text: `\`\`\`ts
|
|
1103
|
+
/**
|
|
1104
|
+
* Starts a Run on a matching Event, binding Event payload paths into the Loop Input. \`values\` are Input fields every
|
|
1105
|
+
* such Run gets, so the Kit that declares the Loop for a Team sets them for that Team.
|
|
1106
|
+
*/
|
|
1107
|
+
export type WhenClause = {
|
|
1108
|
+
readonly event: string
|
|
1109
|
+
readonly filter?: EventFilter
|
|
1110
|
+
readonly input: { readonly [inputField: string]: string }
|
|
1111
|
+
readonly values?: { readonly [inputField: string]: Schema.Json }
|
|
1112
|
+
/** Starts no Run in a Team until the Team turns it on. */
|
|
1113
|
+
readonly optIn?: boolean
|
|
1114
|
+
/** What a Team gets when it turns it on, in a sentence. */
|
|
1115
|
+
readonly description?: string
|
|
1116
|
+
}
|
|
1117
|
+
\`\`\``
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
path: "sdk/loop/define#LoopOffer",
|
|
1121
|
+
title: "@kitman-sh/sdk/loop \u203A LoopOffer",
|
|
1122
|
+
level: 2,
|
|
1123
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1124
|
+
text: "```ts\n/**\n * A Loop the settled Run offers to start, with the Run's Input fields it declares. With `from`, the offer is built from\n * the Output: it shows only when the Output has that field, an object whose fields are given to the offered Loop too.\n */\nexport type LoopOffer = { readonly id: string; readonly title: string; readonly loop: string; readonly from?: string }\n```"
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
path: "sdk/loop/define#LoopServices",
|
|
1128
|
+
title: "@kitman-sh/sdk/loop \u203A LoopServices",
|
|
1129
|
+
level: 2,
|
|
1130
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1131
|
+
text: `\`\`\`ts
|
|
1132
|
+
/** The services a Loop's program runs with; a Runner or \`testLoop\` provides them. */
|
|
1133
|
+
export type LoopServices =
|
|
1134
|
+
| LoopRun
|
|
1135
|
+
| LoopHost
|
|
1136
|
+
| ChangeRequestActivity
|
|
1137
|
+
| WriteBackActivity
|
|
1138
|
+
| ArtifactActivity
|
|
1139
|
+
| FileActivity
|
|
1140
|
+
| NoteActivity
|
|
1141
|
+
| CommentActivity
|
|
1142
|
+
| CreateTasksActivity
|
|
1143
|
+
| AlertTaskActivity
|
|
1144
|
+
| IntegrationBranchActivity
|
|
1145
|
+
| MergeChangeRequestActivity
|
|
1146
|
+
| ReleaseActivity
|
|
1147
|
+
| TranscriptsActivity
|
|
1148
|
+
| ChangeRequestReadActivity
|
|
1149
|
+
| ProposeActivity
|
|
1150
|
+
| ProjectActivityActivity
|
|
1151
|
+
| DraftUpdateActivity
|
|
1152
|
+
| WorkflowEngine.WorkflowEngine
|
|
1153
|
+
| WorkflowEngine.WorkflowInstance
|
|
1154
|
+
\`\`\``
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
path: "sdk/loop/define#LoopSchema",
|
|
1158
|
+
title: "@kitman-sh/sdk/loop \u203A LoopSchema",
|
|
1159
|
+
level: 2,
|
|
1160
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1161
|
+
text: "```ts\n/** A schema a Loop can decode and encode with no services. */\nexport type LoopSchema<T> = Schema.Codec<T, unknown>\n```"
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
path: "sdk/loop/define#LoopDefinition",
|
|
1165
|
+
title: "@kitman-sh/sdk/loop \u203A LoopDefinition",
|
|
1166
|
+
level: 2,
|
|
1167
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1168
|
+
text: `\`\`\`ts
|
|
1169
|
+
export type LoopDefinition<In, Out, E> = {
|
|
1170
|
+
readonly id: string
|
|
1171
|
+
readonly title: string
|
|
1172
|
+
/** Semver, shown under the title: bump major for a changed input, output or behaviour people rely on. */
|
|
1173
|
+
readonly version?: string
|
|
1174
|
+
readonly input: LoopSchema<In>
|
|
1175
|
+
readonly output: LoopSchema<Out>
|
|
1176
|
+
readonly outcome?: LoopOutcome
|
|
1177
|
+
/** Agent ids by role; \`agentWork\` names a role. */
|
|
1178
|
+
readonly agents: { readonly [role: string]: string }
|
|
1179
|
+
readonly checkout: LoopCheckout
|
|
1180
|
+
readonly when?: readonly WhenClause[]
|
|
1181
|
+
readonly offers?: readonly LoopOffer[]
|
|
1182
|
+
readonly capabilities: readonly LoopCapability[]
|
|
1183
|
+
/**
|
|
1184
|
+
* The Loops it runs as Child Runs with \`call\`. A Child Run is granted no more than its parent, so the manifest
|
|
1185
|
+
* declares their capabilities, and \`call\`, besides the Loop's own.
|
|
1186
|
+
*/
|
|
1187
|
+
readonly calls?: () => readonly CalledLoop[]
|
|
1188
|
+
/** The Secrets the program reads with \`Config.Redacted\`, and \`agentWork\` may put into a Step's sandbox. */
|
|
1189
|
+
readonly secrets?: readonly string[]
|
|
1190
|
+
/**
|
|
1191
|
+
* The hosts the program calls besides Kitman, or \`open\` for any; a shared Runner refuses the rest. An \`open\` Loop
|
|
1192
|
+
* runs only on a Runner with \`docker\`, or a personal Runner.
|
|
1193
|
+
*/
|
|
1194
|
+
readonly network?: { readonly hosts: readonly string[] } | 'open'
|
|
1195
|
+
/** A Schedule a Workspace can turn on in one click; off until someone does. */
|
|
1196
|
+
readonly schedule?: { readonly rule: ScheduleRule; readonly timezone: string }
|
|
1197
|
+
readonly run: (input: In) => Effect.Effect<Out, E, LoopServices>
|
|
1198
|
+
/** Scripts a build runs twice, the second time from the journal; not part of the manifest. */
|
|
1199
|
+
readonly checks?: readonly LoopCheck[]
|
|
1200
|
+
}
|
|
1201
|
+
\`\`\``
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
path: "sdk/loop/define#CalledLoop",
|
|
1205
|
+
title: "@kitman-sh/sdk/loop \u203A CalledLoop",
|
|
1206
|
+
level: 2,
|
|
1207
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1208
|
+
text: "```ts\n/** What a parent needs of a Loop it calls. A function, so Loops that call each other can name each other. */\nexport type CalledLoop = {\n readonly capabilities: readonly LoopCapability[]\n readonly calls?: () => readonly CalledLoop[]\n}\n```"
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
path: "sdk/loop/define#capabilitiesOf",
|
|
1212
|
+
title: "@kitman-sh/sdk/loop \u203A capabilitiesOf",
|
|
1213
|
+
level: 2,
|
|
1214
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1215
|
+
text: `\`\`\`ts
|
|
1216
|
+
/** A Loop's own capabilities, and those of every Loop it calls, however deep. */
|
|
1217
|
+
export const capabilitiesOf = (loop: CalledLoop): readonly LoopCapability[] => {
|
|
1218
|
+
const seen = new Set<CalledLoop>()
|
|
1219
|
+
const granted = new Set<LoopCapability>()
|
|
1220
|
+
|
|
1221
|
+
const visit = (current: CalledLoop) => {
|
|
1222
|
+
if (seen.has(current)) return
|
|
1223
|
+
seen.add(current)
|
|
1224
|
+
|
|
1225
|
+
for (const capability of current.capabilities) granted.add(capability)
|
|
1226
|
+
|
|
1227
|
+
const called = current.calls?.() ?? []
|
|
1228
|
+
|
|
1229
|
+
if (called.length > 0) granted.add('call')
|
|
1230
|
+
|
|
1231
|
+
for (const child of called) visit(child)
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
visit(loop)
|
|
1235
|
+
|
|
1236
|
+
return [...granted]
|
|
1237
|
+
}
|
|
1238
|
+
\`\`\``
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
path: "sdk/loop/define#defineLoop",
|
|
1242
|
+
title: "@kitman-sh/sdk/loop \u203A defineLoop",
|
|
1243
|
+
level: 2,
|
|
1244
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1245
|
+
text: "```ts\n/** A Loop module's default export. The definition keeps its shape, so a fork spreads it. */\nexport const defineLoop = <In, Out, E>(definition: LoopDefinition<In, Out, E>): LoopDefinition<In, Out, E> => definition\n```"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
path: "sdk/loop/define#ManifestInvalid",
|
|
1249
|
+
title: "@kitman-sh/sdk/loop \u203A ManifestInvalid",
|
|
1250
|
+
level: 2,
|
|
1251
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1252
|
+
text: "```ts\nexport class ManifestInvalid extends Schema.TaggedError<ManifestInvalid>()('ManifestInvalid', {\n loop: Schema.String,\n message: Schema.String\n}) {}\n```"
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
path: "sdk/loop/define#jsonSchemaOf",
|
|
1256
|
+
title: "@kitman-sh/sdk/loop \u203A jsonSchemaOf",
|
|
1257
|
+
level: 2,
|
|
1258
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1259
|
+
text: `\`\`\`ts
|
|
1260
|
+
export const jsonSchemaOf = <T>(loop: string, schema: LoopSchema<T>) =>
|
|
1261
|
+
Effect.try({
|
|
1262
|
+
try: () => Schema.toJsonSchemaDocument(schema),
|
|
1263
|
+
catch: error => new ManifestInvalid({ loop, message: \`Schema has no JSON Schema: \${String(error)}\` })
|
|
1264
|
+
}).pipe(
|
|
1265
|
+
Effect.flatMap(document =>
|
|
1266
|
+
Schema.decodeUnknownEffect(JsonObjectSchema)({ ...document.schema, $defs: document.definitions }).pipe(
|
|
1267
|
+
Effect.mapError(error => new ManifestInvalid({ loop, message: error.message }))
|
|
1268
|
+
)
|
|
1269
|
+
)
|
|
1270
|
+
)
|
|
1271
|
+
\`\`\``
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
path: "sdk/loop/define#loopManifest",
|
|
1275
|
+
title: "@kitman-sh/sdk/loop \u203A loopManifest",
|
|
1276
|
+
level: 2,
|
|
1277
|
+
link: "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/types/packages/sdk/src/loop/define.d.ts",
|
|
1278
|
+
text: `\`\`\`ts
|
|
1279
|
+
/** The data the control plane reads from a Loop, made without calling \`run\`. */
|
|
1280
|
+
export const loopManifest = <In, Out, E>(
|
|
1281
|
+
definition: LoopDefinition<In, Out, E>
|
|
1282
|
+
): Effect.Effect<LoopManifest, ManifestInvalid> =>
|
|
1283
|
+
Effect.gen(function* () {
|
|
1284
|
+
yield* declarationsAreData(definition)
|
|
1285
|
+
|
|
1286
|
+
if (definition.version !== undefined && !Schema.is(LoopVersion)(definition.version))
|
|
1287
|
+
return yield* new ManifestInvalid({
|
|
1288
|
+
loop: definition.id,
|
|
1289
|
+
message: \`version "\${String(definition.version)}" is not semver, such as 2.0.0\`
|
|
1290
|
+
})
|
|
1291
|
+
|
|
1292
|
+
return {
|
|
1293
|
+
id: definition.id,
|
|
1294
|
+
title: definition.title,
|
|
1295
|
+
...(definition.version === undefined ? undefined : { version: definition.version }),
|
|
1296
|
+
input: yield* jsonSchemaOf(definition.id, definition.input),
|
|
1297
|
+
output: yield* jsonSchemaOf(definition.id, definition.output),
|
|
1298
|
+
...(definition.outcome === undefined ? undefined : { outcome: definition.outcome }),
|
|
1299
|
+
agents: definition.agents,
|
|
1300
|
+
checkout: definition.checkout,
|
|
1301
|
+
when: definition.when ?? [],
|
|
1302
|
+
offers: definition.offers ?? [],
|
|
1303
|
+
capabilities: capabilitiesOf(definition),
|
|
1304
|
+
...((definition.calls?.() ?? []).length === 0 ? undefined : { ownCapabilities: definition.capabilities }),
|
|
1305
|
+
...(definition.secrets === undefined ? undefined : { secrets: definition.secrets }),
|
|
1306
|
+
...(definition.network === undefined ? undefined : { network: definition.network }),
|
|
1307
|
+
...(definition.schedule === undefined ? undefined : { schedule: definition.schedule })
|
|
1308
|
+
}
|
|
1309
|
+
})
|
|
1310
|
+
\`\`\``
|
|
1311
|
+
}
|
|
1312
|
+
];
|
|
1313
|
+
|
|
1314
|
+
// apps/mcp/src/docs/docs-search.ts
|
|
1315
|
+
var DefaultDocsSearchLimit2 = 8;
|
|
1316
|
+
var MaxDocsSearchLimit = 50;
|
|
1317
|
+
var ExcerptLength = 220;
|
|
1318
|
+
var TitleWeight = 3;
|
|
1319
|
+
var ExactNameWeight = 3;
|
|
1320
|
+
var stopWords = new Set([
|
|
1321
|
+
"a",
|
|
1322
|
+
"an",
|
|
1323
|
+
"the",
|
|
1324
|
+
"in",
|
|
1325
|
+
"into",
|
|
1326
|
+
"to",
|
|
1327
|
+
"of",
|
|
1328
|
+
"on",
|
|
1329
|
+
"for",
|
|
1330
|
+
"from",
|
|
1331
|
+
"with",
|
|
1332
|
+
"my",
|
|
1333
|
+
"its",
|
|
1334
|
+
"and",
|
|
1335
|
+
"or",
|
|
1336
|
+
"how",
|
|
1337
|
+
"do",
|
|
1338
|
+
"i",
|
|
1339
|
+
"is",
|
|
1340
|
+
"it",
|
|
1341
|
+
"what",
|
|
1342
|
+
"can"
|
|
1343
|
+
]);
|
|
1344
|
+
var words = (text) => text.replaceAll(/([a-z0-9])([A-Z])/gu, "$1 $2").toLowerCase().split(/[^a-z0-9]+/u).filter((word) => word.length > 0);
|
|
1345
|
+
var stem = (word) => {
|
|
1346
|
+
if (word.length > 4 && word.endsWith("ies"))
|
|
1347
|
+
return `${word.slice(0, -3)}y`;
|
|
1348
|
+
if (word.length > 5 && word.endsWith("ing"))
|
|
1349
|
+
return word.slice(0, -3);
|
|
1350
|
+
if (word.length > 4 && word.endsWith("ed"))
|
|
1351
|
+
return word.slice(0, -2);
|
|
1352
|
+
if (word.length > 4 && word.endsWith("es"))
|
|
1353
|
+
return word.slice(0, -1).replace(/e$/u, "");
|
|
1354
|
+
const singular = word.length > 3 && word.endsWith("s") && !word.endsWith("ss") ? word.slice(0, -1) : word;
|
|
1355
|
+
return singular.replace(/e$/u, "");
|
|
1356
|
+
};
|
|
1357
|
+
var terms = (text) => words(text).map(stem);
|
|
1358
|
+
var indexSections = (sections) => {
|
|
1359
|
+
const indexed = sections.map((section) => {
|
|
1360
|
+
const frequencies = new Map;
|
|
1361
|
+
const add = (term, weight) => frequencies.set(term, (frequencies.get(term) ?? 0) + weight);
|
|
1362
|
+
for (const term of terms(section.title))
|
|
1363
|
+
add(term, TitleWeight);
|
|
1364
|
+
const textTerms = terms(section.text);
|
|
1365
|
+
for (const term of textTerms)
|
|
1366
|
+
add(term, 1);
|
|
1367
|
+
return { section, frequencies, length: textTerms.length };
|
|
1368
|
+
});
|
|
1369
|
+
const documentFrequency = new Map;
|
|
1370
|
+
for (const { frequencies } of indexed)
|
|
1371
|
+
for (const term of frequencies.keys())
|
|
1372
|
+
documentFrequency.set(term, (documentFrequency.get(term) ?? 0) + 1);
|
|
1373
|
+
const averageLength = indexed.reduce((sum, { length }) => sum + length, 0) / Math.max(indexed.length, 1);
|
|
1374
|
+
return { indexed, documentFrequency, averageLength };
|
|
1375
|
+
};
|
|
1376
|
+
var shippedIndex;
|
|
1377
|
+
var shipped = () => shippedIndex ??= indexSections(docsIndex);
|
|
1378
|
+
function searchDocs2(input) {
|
|
1379
|
+
const index = shipped();
|
|
1380
|
+
const queryTerms = [...new Set(words(input.query).filter((word) => !stopWords.has(word)))].map(stem);
|
|
1381
|
+
const named = new Set(input.query.toLowerCase().match(/[a-z0-9_]+/gu));
|
|
1382
|
+
const limit = Math.min(Math.max(Math.floor(input.limit ?? DefaultDocsSearchLimit2), 1), MaxDocsSearchLimit);
|
|
1383
|
+
const scored = index.indexed.flatMap(({ section, frequencies, length }) => {
|
|
1384
|
+
let score = 0;
|
|
1385
|
+
let matched = 0;
|
|
1386
|
+
for (const term of queryTerms) {
|
|
1387
|
+
const frequency = frequencies.get(term) ?? 0;
|
|
1388
|
+
if (frequency === 0)
|
|
1389
|
+
continue;
|
|
1390
|
+
matched += 1;
|
|
1391
|
+
const sections = index.documentFrequency.get(term) ?? 0;
|
|
1392
|
+
const idf = Math.log(1 + (index.indexed.length - sections + 0.5) / (sections + 0.5));
|
|
1393
|
+
score += idf * frequency * 2.2 / (frequency + 1.2 * (0.25 + 0.75 * length / index.averageLength));
|
|
1394
|
+
}
|
|
1395
|
+
const weight = named.has(exportName(section).toLowerCase()) ? ExactNameWeight : 1;
|
|
1396
|
+
return matched === 0 ? [] : [{ section, score: score * weight * (matched / queryTerms.length) }];
|
|
1397
|
+
});
|
|
1398
|
+
const ranked = scored.toSorted((left, right) => right.score - left.score);
|
|
1399
|
+
return {
|
|
1400
|
+
items: ranked.slice(0, limit).map(({ section, score }) => ({
|
|
1401
|
+
title: section.title,
|
|
1402
|
+
path: section.path,
|
|
1403
|
+
link: pinnedLink2(section.link),
|
|
1404
|
+
excerpt: excerpt(section.text, queryTerms),
|
|
1405
|
+
score: Math.round(score * 100) / 100
|
|
1406
|
+
})),
|
|
1407
|
+
total: ranked.length
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
function readDoc2(input) {
|
|
1411
|
+
const sections = docsIndex;
|
|
1412
|
+
const path = pathOfLink(input.path.trim());
|
|
1413
|
+
const exact = sections.findIndex((section) => section.path === path);
|
|
1414
|
+
const start = exact >= 0 ? exact : sections.findIndex((section) => section.path.toLowerCase() === path.toLowerCase());
|
|
1415
|
+
const section = sections[start];
|
|
1416
|
+
if (section === undefined)
|
|
1417
|
+
return {
|
|
1418
|
+
error: {
|
|
1419
|
+
code: "doc_not_found",
|
|
1420
|
+
message: `No docs section at ${input.path}. Search with kitman docs search, or kitman.docs.search in Code Mode.`,
|
|
1421
|
+
suggestions: searchDocs2({ query: path, limit: 5 }).items.map((hit) => hit.path)
|
|
1422
|
+
}
|
|
1423
|
+
};
|
|
1424
|
+
const page = pageOf(section.path);
|
|
1425
|
+
const nested = [];
|
|
1426
|
+
for (const next of sections.slice(start + 1)) {
|
|
1427
|
+
if (pageOf(next.path) !== page || next.level <= section.level)
|
|
1428
|
+
break;
|
|
1429
|
+
nested.push(next);
|
|
1430
|
+
}
|
|
1431
|
+
return {
|
|
1432
|
+
title: section.title,
|
|
1433
|
+
path: section.path,
|
|
1434
|
+
link: pinnedLink2(section.link),
|
|
1435
|
+
text: [section, ...nested].map((part) => part.text).join(`
|
|
1436
|
+
|
|
1437
|
+
`)
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1440
|
+
var pathOfLink = (link) => {
|
|
1441
|
+
const page = /^(?:https:\/\/[^/]+)?\/?(?:knowledge\/)?docs(?:\/(.*))?$/u.exec(link);
|
|
1442
|
+
return page === null ? link : page[1] || "index";
|
|
1443
|
+
};
|
|
1444
|
+
var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
|
|
1445
|
+
var pinnedLink2 = (link, version = "0.12.0-rc.1") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
|
|
1446
|
+
var pageOf = (path) => path.split("#")[0];
|
|
1447
|
+
var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
|
|
1448
|
+
function excerpt(text, queryTerms) {
|
|
1449
|
+
const plain = text.replaceAll(/^```\w*$/gmu, "").replaceAll(/^#+ /gmu, "").replaceAll(/\s+/gu, " ").trim();
|
|
1450
|
+
const lower = plain.toLowerCase();
|
|
1451
|
+
const hits = queryTerms.flatMap((term) => [...lower.matchAll(new RegExp(`\\b${term}`, "gu"))].map((match) => ({ term, at: match.index })));
|
|
1452
|
+
const termsFrom = (from) => new Set(hits.flatMap((hit) => hit.at >= from && hit.at < from + ExcerptLength - 20 ? [hit.term] : [])).size;
|
|
1453
|
+
const starts = [0, ...hits.map((hit) => Math.max(0, plain.lastIndexOf(" ", Math.max(0, hit.at - 40)) + 1))];
|
|
1454
|
+
const from = starts.reduce((best, candidate) => termsFrom(candidate) > termsFrom(best) ? candidate : best, 0);
|
|
1455
|
+
const more = from + ExcerptLength < plain.length;
|
|
1456
|
+
const window = plain.slice(from, from + ExcerptLength);
|
|
1457
|
+
return `${from > 0 ? "\u2026" : ""}${more ? window.slice(0, window.lastIndexOf(" ")) : window}${more ? "\u2026" : ""}`;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
export { DefaultDocsSearchLimit2, searchDocs2, readDoc2, pinnedLink2 };
|