@onepointfour-packs/flaredeck-agent 0.2.36 → 0.2.38
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/boards.d.ts +72 -0
- package/dist/boards.js +136 -0
- package/dist/boards.js.map +1 -0
- package/dist/browser.d.ts +7 -0
- package/dist/browser.js +77 -11
- package/dist/browser.js.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/environment.d.ts +22 -1
- package/dist/environment.js +95 -8
- package/dist/environment.js.map +1 -1
- package/dist/flaredeck-proxy.d.ts +11 -1
- package/dist/flaredeck-proxy.js +27 -1
- package/dist/flaredeck-proxy.js.map +1 -1
- package/dist/main.js +56 -15
- package/dist/main.js.map +1 -1
- package/dist/picker.d.ts +10 -0
- package/dist/picker.js +104 -0
- package/dist/picker.js.map +1 -0
- package/dist/repopicker.js +8 -96
- package/dist/repopicker.js.map +1 -1
- package/dist/runs.d.ts +9 -2
- package/dist/runs.js +33 -5
- package/dist/runs.js.map +1 -1
- package/dist/serve.d.ts +6 -0
- package/dist/serve.js +286 -40
- package/dist/serve.js.map +1 -1
- package/dist/stream.d.ts +4 -0
- package/dist/stream.js.map +1 -1
- package/dist/team.js +7 -1
- package/dist/team.js.map +1 -1
- package/dist/tmux.d.ts +1 -0
- package/dist/tmux.js +47 -0
- package/dist/tmux.js.map +1 -0
- package/dist/ui.d.ts +4 -1
- package/dist/ui.js +38 -20
- package/dist/ui.js.map +1 -1
- package/dist/workspace.d.ts +28 -2
- package/dist/workspace.js +39 -2
- package/dist/workspace.js.map +1 -1
- package/package.json +1 -1
package/dist/boards.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export type BoardSeen = {
|
|
2
|
+
key: string;
|
|
3
|
+
name: string;
|
|
4
|
+
prefix: string;
|
|
5
|
+
tenant: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Pull the account's boards out of `list-boards`.
|
|
9
|
+
*
|
|
10
|
+
* It answers in markdown for a person to read, which is the only interface there is, so this
|
|
11
|
+
* parses it — and returns nothing rather than guessing if the shape ever changes. A login that
|
|
12
|
+
* cannot offer the list keeps the old behaviour (every board), which is the safe direction: an
|
|
13
|
+
* agent that hears about too much is noisy, one scoped to a board it cannot see is deaf.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseBoards(text: string): BoardSeen[];
|
|
16
|
+
/**
|
|
17
|
+
* Ask, and return what to save. Null when there was nothing to ask or nobody to answer, which
|
|
18
|
+
* leaves whatever is already in the config alone.
|
|
19
|
+
*/
|
|
20
|
+
export declare function askBoards(
|
|
21
|
+
/**
|
|
22
|
+
* Fetches the board list. Passed in rather than imported, so this module stays free of the
|
|
23
|
+
* proxy — it also holds the rules the proxy itself needs, and the two importing each other is
|
|
24
|
+
* a cycle nobody benefits from.
|
|
25
|
+
*/
|
|
26
|
+
list: () => Promise<string>, say: (s: string) => void, already?: readonly {
|
|
27
|
+
key: string;
|
|
28
|
+
name: string;
|
|
29
|
+
}[]): Promise<{
|
|
30
|
+
key: string;
|
|
31
|
+
name: string;
|
|
32
|
+
}[] | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Is this event on a board this agent works? `mine` empty means every board.
|
|
35
|
+
*
|
|
36
|
+
* An event with no board — a direct message, a scheduled run, a question typed in the pane —
|
|
37
|
+
* always comes through. Somebody addressing this agent personally is addressing it whatever board
|
|
38
|
+
* they were looking at, and an agent that cannot be reached is worse than one that is noisy.
|
|
39
|
+
*
|
|
40
|
+
* Pure, and here rather than inside the daemon, so the test exercises the rule the daemon uses
|
|
41
|
+
* instead of a second copy of it that can drift.
|
|
42
|
+
*/
|
|
43
|
+
export declare function onMyBoards(mine: ReadonlySet<string>, event: {
|
|
44
|
+
boardKey?: string;
|
|
45
|
+
}): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* How to ask an account-wide tool for just these boards.
|
|
48
|
+
*
|
|
49
|
+
* One board goes as a plain string: the server can then use its (boardId, done, updatedAt) index
|
|
50
|
+
* instead of filtering in memory, and a server deployed before the list form does `board.trim()`,
|
|
51
|
+
* which an array would throw on. The harness updates itself and the function it talks to is
|
|
52
|
+
* deployed separately — they are never in step, so the older shape is used wherever it fits.
|
|
53
|
+
*/
|
|
54
|
+
export declare function boardArg(boards: readonly string[]): string | string[] | undefined;
|
|
55
|
+
export type OutstandingCard = {
|
|
56
|
+
code: string;
|
|
57
|
+
boardKey: string;
|
|
58
|
+
cardKey: string;
|
|
59
|
+
tenantId: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The cards in a `get-outstanding` answer, read from the fields it prints rather than guessed
|
|
63
|
+
* from the shape of a card code.
|
|
64
|
+
*
|
|
65
|
+
* It used to be a regex for the code alone — `[A-Z][A-Z0-9]{1,9}-\d{3,}` — which capped the
|
|
66
|
+
* prefix at ten characters, so a board like DOCUMENTREPOSITOR was invisible to it, and which
|
|
67
|
+
* could not tell which BOARD a card was on at all. Each block names both:
|
|
68
|
+
*
|
|
69
|
+
* ### 1. ⭐ [KD-1362] Some card
|
|
70
|
+
* - **IDs**: board=`...` card=`...` tenant=`...`
|
|
71
|
+
*/
|
|
72
|
+
export declare function outstandingCards(text: string): OutstandingCard[];
|
package/dist/boards.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which boards this agent works.
|
|
3
|
+
*
|
|
4
|
+
* An agent was only ever bound to a TENANT. Signed in as a person, or as an account with broad
|
|
5
|
+
* access, it woke for every card and every message on every board that account could see — on
|
|
6
|
+
* this machine, twenty-one boards across nine tenants. The cost is not noise on a screen: every
|
|
7
|
+
* one of those is a turn, and a turn is context and money. A test agent spent 23k of context
|
|
8
|
+
* reaching the conclusion that a two-week-old message on another team's board needed no reply.
|
|
9
|
+
*
|
|
10
|
+
* Asked at login, with the real list, and saved by key. Nothing picked means every board, which
|
|
11
|
+
* is what every install did before this existed.
|
|
12
|
+
*/
|
|
13
|
+
import { pickMany } from './picker.js';
|
|
14
|
+
/**
|
|
15
|
+
* Pull the account's boards out of `list-boards`.
|
|
16
|
+
*
|
|
17
|
+
* It answers in markdown for a person to read, which is the only interface there is, so this
|
|
18
|
+
* parses it — and returns nothing rather than guessing if the shape ever changes. A login that
|
|
19
|
+
* cannot offer the list keeps the old behaviour (every board), which is the safe direction: an
|
|
20
|
+
* agent that hears about too much is noisy, one scoped to a board it cannot see is deaf.
|
|
21
|
+
*/
|
|
22
|
+
export function parseBoards(text) {
|
|
23
|
+
const out = [];
|
|
24
|
+
// ### 3. Bird Test (BIR)
|
|
25
|
+
// - **Board ID**: `-Nfu4b8oysFXt43xZRrP` · **Tenant**: `phiresky-XjajBeaKtYN41nlNVcAE`
|
|
26
|
+
const blocks = text.split(/^### /m).slice(1);
|
|
27
|
+
for (const b of blocks) {
|
|
28
|
+
const head = b.split('\n')[0] ?? '';
|
|
29
|
+
const name = head.replace(/^\d+\.\s*/, '').replace(/\s*\([^)]*\)\s*$/, '').trim();
|
|
30
|
+
const prefix = (head.match(/\(([^)]+)\)\s*$/)?.[1] ?? '').trim();
|
|
31
|
+
const key = (b.match(/\*\*Board ID\*\*:\s*`([^`]+)`/)?.[1] ?? '').trim();
|
|
32
|
+
const tenant = (b.match(/\*\*Tenant\*\*:\s*`([^`]+)`/)?.[1] ?? '').trim();
|
|
33
|
+
if (key && name)
|
|
34
|
+
out.push({ key, name, prefix, tenant });
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Ask, and return what to save. Null when there was nothing to ask or nobody to answer, which
|
|
40
|
+
* leaves whatever is already in the config alone.
|
|
41
|
+
*/
|
|
42
|
+
export async function askBoards(
|
|
43
|
+
/**
|
|
44
|
+
* Fetches the board list. Passed in rather than imported, so this module stays free of the
|
|
45
|
+
* proxy — it also holds the rules the proxy itself needs, and the two importing each other is
|
|
46
|
+
* a cycle nobody benefits from.
|
|
47
|
+
*/
|
|
48
|
+
list, say, already) {
|
|
49
|
+
let seen = [];
|
|
50
|
+
try {
|
|
51
|
+
seen = parseBoards(await list());
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
say(` Could not list boards (${e instanceof Error ? e.message : String(e)}) — leaving this agent on every board.`);
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (seen.length < 2) {
|
|
58
|
+
if (seen.length === 1)
|
|
59
|
+
say(` One board on this account: ${seen[0].name}.`);
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const prior = already?.length ? new Set(already.map((b) => b.key)) : null;
|
|
63
|
+
// Everything, when nothing was chosen before — the same scope the agent had until now, so a
|
|
64
|
+
// person who presses enter changes nothing.
|
|
65
|
+
const initial = new Set(seen.filter((b) => (prior ? prior.has(b.key) : true)).map((b) => b.key));
|
|
66
|
+
if (!process.stdin.isTTY) {
|
|
67
|
+
const kept = seen.filter((b) => initial.has(b.key));
|
|
68
|
+
say(`\n Not a terminal, so nothing was asked — keeping ${kept.length} of ${seen.length} boards.`);
|
|
69
|
+
return kept.length === seen.length ? [] : kept.map((b) => ({ key: b.key, name: b.name }));
|
|
70
|
+
}
|
|
71
|
+
// Several tenants is the case worth showing: it is how an agent ends up woken by a board that
|
|
72
|
+
// belongs to another client entirely.
|
|
73
|
+
const tenants = new Set(seen.map((b) => b.tenant)).size;
|
|
74
|
+
const picked = await pickMany('Which boards does this agent work?', `${seen.length} on this account${tenants > 1 ? ` across ${tenants} tenants` : ''}`, seen.map((b) => ({
|
|
75
|
+
id: b.key,
|
|
76
|
+
label: b.name,
|
|
77
|
+
note: [b.prefix, tenants > 1 ? b.tenant.replace(/-\d{10,}$/, '') : ''].filter(Boolean).join(' · '),
|
|
78
|
+
})), initial);
|
|
79
|
+
if (!picked)
|
|
80
|
+
return null;
|
|
81
|
+
// Every board ticked is the same as no restriction, and saying so beats a saved list that has
|
|
82
|
+
// to be maintained in step with the account.
|
|
83
|
+
if (picked.length === seen.length)
|
|
84
|
+
return [];
|
|
85
|
+
const byKey = new Map(seen.map((b) => [b.key, b.name]));
|
|
86
|
+
return picked.map((key) => ({ key, name: byKey.get(key) ?? key }));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Is this event on a board this agent works? `mine` empty means every board.
|
|
90
|
+
*
|
|
91
|
+
* An event with no board — a direct message, a scheduled run, a question typed in the pane —
|
|
92
|
+
* always comes through. Somebody addressing this agent personally is addressing it whatever board
|
|
93
|
+
* they were looking at, and an agent that cannot be reached is worse than one that is noisy.
|
|
94
|
+
*
|
|
95
|
+
* Pure, and here rather than inside the daemon, so the test exercises the rule the daemon uses
|
|
96
|
+
* instead of a second copy of it that can drift.
|
|
97
|
+
*/
|
|
98
|
+
export function onMyBoards(mine, event) {
|
|
99
|
+
return !mine.size || !event.boardKey || mine.has(event.boardKey);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* How to ask an account-wide tool for just these boards.
|
|
103
|
+
*
|
|
104
|
+
* One board goes as a plain string: the server can then use its (boardId, done, updatedAt) index
|
|
105
|
+
* instead of filtering in memory, and a server deployed before the list form does `board.trim()`,
|
|
106
|
+
* which an array would throw on. The harness updates itself and the function it talks to is
|
|
107
|
+
* deployed separately — they are never in step, so the older shape is used wherever it fits.
|
|
108
|
+
*/
|
|
109
|
+
export function boardArg(boards) {
|
|
110
|
+
if (!boards.length)
|
|
111
|
+
return undefined;
|
|
112
|
+
return boards.length === 1 ? boards[0] : [...boards];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The cards in a `get-outstanding` answer, read from the fields it prints rather than guessed
|
|
116
|
+
* from the shape of a card code.
|
|
117
|
+
*
|
|
118
|
+
* It used to be a regex for the code alone — `[A-Z][A-Z0-9]{1,9}-\d{3,}` — which capped the
|
|
119
|
+
* prefix at ten characters, so a board like DOCUMENTREPOSITOR was invisible to it, and which
|
|
120
|
+
* could not tell which BOARD a card was on at all. Each block names both:
|
|
121
|
+
*
|
|
122
|
+
* ### 1. ⭐ [KD-1362] Some card
|
|
123
|
+
* - **IDs**: board=`...` card=`...` tenant=`...`
|
|
124
|
+
*/
|
|
125
|
+
export function outstandingCards(text) {
|
|
126
|
+
const out = [];
|
|
127
|
+
for (const block of text.split(/^### /m).slice(1)) {
|
|
128
|
+
const code = (block.split('\n')[0] ?? '').match(/\[([^\]]+)\]/)?.[1]?.trim() ?? '';
|
|
129
|
+
const ids = block.match(/\*\*IDs\*\*:\s*board=`([^`]*)`\s*card=`([^`]*)`(?:\s*tenant=`([^`]*)`)?/);
|
|
130
|
+
if (!code || !ids)
|
|
131
|
+
continue;
|
|
132
|
+
out.push({ code, boardKey: (ids[1] ?? '').trim(), cardKey: (ids[2] ?? '').trim(), tenantId: (ids[3] ?? '').trim() });
|
|
133
|
+
}
|
|
134
|
+
return out;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=boards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boards.js","sourceRoot":"","sources":["../src/boards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,GAAG,GAAgB,EAAE,CAAC;IAC5B,yBAAyB;IACzB,uFAAuF;IACvF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC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|
package/dist/browser.d.ts
CHANGED
|
@@ -7,6 +7,12 @@ export type BrowserDeps = {
|
|
|
7
7
|
repo: string;
|
|
8
8
|
/** Addresses the environment reported, so the agent names a part rather than a port. */
|
|
9
9
|
endpoints: () => Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Deployed addresses the BOARD declared — the dev or UAT site, not production. A card is often
|
|
12
|
+
* about code that is already live, and an agent that can only see what it started locally
|
|
13
|
+
* cannot tell "my change is wrong" from "it was already like that".
|
|
14
|
+
*/
|
|
15
|
+
sites?: () => Record<string, string>;
|
|
10
16
|
/** Credentials the project published, so nobody types a password into a model. */
|
|
11
17
|
contract: () => EnvContract | undefined;
|
|
12
18
|
/** Where a screenshot should land so the agent can attach it to a card. */
|
|
@@ -16,4 +22,5 @@ export type BrowserDeps = {
|
|
|
16
22
|
export declare function browserTools(deps: BrowserDeps): {
|
|
17
23
|
server: unknown;
|
|
18
24
|
toolNames: string[];
|
|
25
|
+
close: () => Promise<void>;
|
|
19
26
|
};
|
package/dist/browser.js
CHANGED
|
@@ -81,6 +81,45 @@ async function installChromium() {
|
|
|
81
81
|
execFile(process.execPath, [cli, 'install', 'chromium-headless-shell'], { timeout: 10 * 60_000 }, (err) => resolve(!err));
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Somewhere this browser may go.
|
|
86
|
+
*
|
|
87
|
+
* An agent that has just written and started its own start script knows a URL the harness does
|
|
88
|
+
* not, so refusing everything but a named part leaves it unable to look at what it just brought
|
|
89
|
+
* up. Allowing anything, though, would make a project tool into a web browser — and a page is
|
|
90
|
+
* input: whatever is written on it arrives in the agent's turn. So: this machine, a private
|
|
91
|
+
* network, or a site the board itself named. Nothing else.
|
|
92
|
+
*/
|
|
93
|
+
function addressable(url, declared) {
|
|
94
|
+
let u;
|
|
95
|
+
try {
|
|
96
|
+
u = new URL(url);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return `"${url}" is not a URL.`;
|
|
100
|
+
}
|
|
101
|
+
if (!/^https?:$/.test(u.protocol))
|
|
102
|
+
return `Only http and https. "${u.protocol}" is neither.`;
|
|
103
|
+
const h = u.hostname.toLowerCase();
|
|
104
|
+
const local = h === 'localhost' || h.endsWith('.localhost') || h === '::1' || h === '[::1]' ||
|
|
105
|
+
/^127\./.test(h) || /^10\./.test(h) || /^192\.168\./.test(h) ||
|
|
106
|
+
/^172\.(1[6-9]|2\d|3[01])\./.test(h);
|
|
107
|
+
if (local)
|
|
108
|
+
return null;
|
|
109
|
+
const named = declared.some((d) => {
|
|
110
|
+
try {
|
|
111
|
+
return new URL(d).origin === u.origin;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
if (named)
|
|
118
|
+
return null;
|
|
119
|
+
return (`${u.origin} is not this project's. A URL is allowed when it is on this machine or private ` +
|
|
120
|
+
`network, or when the board declared it as a site. Open a part by name instead` +
|
|
121
|
+
(declared.length ? `, or one of the sites the board named: ${declared.join(', ')}.` : '.'));
|
|
122
|
+
}
|
|
84
123
|
export function browserTools(deps) {
|
|
85
124
|
let live = null;
|
|
86
125
|
const closeQuietly = async () => {
|
|
@@ -116,20 +155,42 @@ export function browserTools(deps) {
|
|
|
116
155
|
name: 'browser',
|
|
117
156
|
version: '1.0.0',
|
|
118
157
|
tools: [
|
|
119
|
-
tool('open_page', 'Open a page in a real browser
|
|
120
|
-
'
|
|
121
|
-
'
|
|
122
|
-
'learned about this project.', {
|
|
123
|
-
part: z.string().optional().describe('Which part
|
|
158
|
+
tool('open_page', 'Open a page in a real browser. Name a part THIS card\'s environment reported (for ' +
|
|
159
|
+
'example "ui") rather than a port — several worktrees run at once and the ports differ. ' +
|
|
160
|
+
'A deployed site the board declared can be named the same way. Returns what is on the ' +
|
|
161
|
+
'page, and anything earlier sessions learned about this project.', {
|
|
162
|
+
part: z.string().optional().describe('Which part, e.g. "ui". Defaults to the first one.'),
|
|
124
163
|
path: z.string().optional().describe('A path on that part, e.g. "/admin/learning".'),
|
|
164
|
+
url: z.string().optional().describe('A full address, for something you started yourself that no part names yet. ' +
|
|
165
|
+
'This machine, a private network, or a site the board declared.'),
|
|
125
166
|
}, async (args) => {
|
|
126
|
-
const { part, path } = args;
|
|
167
|
+
const { part, path, url: asked } = args;
|
|
127
168
|
const ends = deps.endpoints();
|
|
128
|
-
const
|
|
129
|
-
|
|
169
|
+
const declared = deps.sites?.() ?? {};
|
|
170
|
+
// Both sources answer to a name. A part the environment started wins a name collision,
|
|
171
|
+
// because that is this card's own code and the deployed one is not.
|
|
172
|
+
const all = { ...declared, ...ends };
|
|
173
|
+
let name = part || (all['ui'] ? 'ui' : Object.keys(all)[0] ?? '');
|
|
174
|
+
let base = all[name];
|
|
175
|
+
if (asked) {
|
|
176
|
+
const no = addressable(asked, Object.values(declared));
|
|
177
|
+
if (no)
|
|
178
|
+
return say(no, true);
|
|
179
|
+
base = asked;
|
|
180
|
+
// Named parts keep their saved session; a bare URL is identified by its host, so
|
|
181
|
+
// coming back to the same place twice is still the same place.
|
|
182
|
+
if (!part)
|
|
183
|
+
name = new URL(asked).host;
|
|
184
|
+
}
|
|
130
185
|
if (!base) {
|
|
131
|
-
|
|
132
|
-
|
|
186
|
+
const have = Object.entries(all).map(([k, v]) => ` · ${k}: ${v}`).join('\n');
|
|
187
|
+
return say(have
|
|
188
|
+
? `Nothing here is called "${name}". What there is:\n${have}`
|
|
189
|
+
: `Nothing is running that this card knows about, and the board declared no site.\n\n` +
|
|
190
|
+
`If you started something yourself, pass its \`url\` — this machine or a private ` +
|
|
191
|
+
`network is allowed. If this project has no way to come up at all, that is worth ` +
|
|
192
|
+
`fixing once: a \`${'.flaredeck/start.sh'}\` that brings it up and prints ` +
|
|
193
|
+
`\`name=url\` lines gives every future card on this board a browser.`, true);
|
|
133
194
|
}
|
|
134
195
|
const site = siteIdentity(deps.repo, name);
|
|
135
196
|
const memory = loadMemory(site);
|
|
@@ -256,6 +317,11 @@ export function browserTools(deps) {
|
|
|
256
317
|
}),
|
|
257
318
|
],
|
|
258
319
|
});
|
|
259
|
-
|
|
320
|
+
// A turn's browser must go when the turn does. Nothing used to close it: a new tool set is
|
|
321
|
+
// built per turn, so the last one's Chromium became unreachable AND still running — one leaked
|
|
322
|
+
// browser tree for every turn that looked at anything, on a daemon that runs for days. This is
|
|
323
|
+
// the same shape as the start scripts nobody took down, which left a build box at 106 node
|
|
324
|
+
// processes and 276 MB free.
|
|
325
|
+
return { server, toolNames: BROWSER_TOOL_NAMES, close: closeQuietly };
|
|
260
326
|
}
|
|
261
327
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,yBAAyB;IACzB,oBAAoB;IACpB,qBAAqB;IACrB,oBAAoB;IACpB,0BAA0B;IAC1B,wBAAwB;CACzB,CAAC;AAEF,iGAAiG;AACjG,MAAM,YAAY,GAAG,IAAI,CAAC;AAI1B,MAAM,SAAS,GAAG,GAAW,EAAE;IAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;IACvC,IAAI,CAAC;QAAC,SAAS,CAA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,IAAI,EAAE,MAAM,CAAC,CAAC;gBACzB,uDAAuD;gBACvD,IAAI,IAAI,EAAE,CAAC;oBACT,IAAI,CAAC;wBAAC,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBAAC,CAAC;oBAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;gBACnG,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,wBAAwB,KAAK,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;gBACjE,OAAO,GAAG,CAAC,iBAAiB,IAAI,6CAA6C,CAAC,CAAC;YACjF,CAAC,CACF;SACF;KACF,CAAC,CAAC;IAEH,2FAA2F;IAC3F,+FAA+F;IAC/F,+FAA+F;IAC/F,2FAA2F;IAC3F,6BAA6B;IAC7B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACxE,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -19,6 +19,22 @@ export type Config = {
|
|
|
19
19
|
* folder grants nothing — and empty or absent means every repo found there.
|
|
20
20
|
*/
|
|
21
21
|
repos?: string[];
|
|
22
|
+
/**
|
|
23
|
+
* The boards this agent works, ticked at login. Empty or absent means every board the account
|
|
24
|
+
* can see, which is what every install did before this existed.
|
|
25
|
+
*
|
|
26
|
+
* An agent was only ever bound to a TENANT, so one signed in as a person — or as an account
|
|
27
|
+
* with broad access — woke for every card and every message on every board in it. The cost is
|
|
28
|
+
* not the noise: it is a turn. A test agent spent 23k of context deciding that a two-week-old
|
|
29
|
+
* message on another team's board needed no reply. Scope is cheaper than judgement.
|
|
30
|
+
*
|
|
31
|
+
* The name is kept beside the key so `whoami` can say which boards without a round trip, and
|
|
32
|
+
* so a board that is renamed still reads sensibly until the next login.
|
|
33
|
+
*/
|
|
34
|
+
boards?: {
|
|
35
|
+
key: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}[];
|
|
22
38
|
/**
|
|
23
39
|
* Git-ignored files a project needs in order to RUN, carried into each card's worktree.
|
|
24
40
|
*
|
package/dist/config.js
CHANGED
|
@@ -28,6 +28,7 @@ export function loadConfig(repo = process.cwd()) {
|
|
|
28
28
|
return {
|
|
29
29
|
repo: raw.repo ?? process.cwd(),
|
|
30
30
|
...(raw.repos?.length ? { repos: raw.repos } : {}),
|
|
31
|
+
...(raw.boards?.length ? { boards: raw.boards.filter((b) => b?.key) } : {}),
|
|
31
32
|
...(raw.worktreeLocalFiles?.length ? { worktreeLocalFiles: raw.worktreeLocalFiles } : {}),
|
|
32
33
|
mcpServerName: raw.mcpServerName ?? DEFAULTS.mcpServerName,
|
|
33
34
|
mcpUrl: raw.mcpUrl ?? DEFAULTS.mcpUrl,
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA6H1C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,aAAa,EAAE,WAAW;IAC1B,MAAM,EAAE,+BAA+B;IACvC,eAAe,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mBAAmB,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,gBAAgB,CAAC,OAAe,OAAO,CAAC,GAAG,EAAE;IAC3D,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,QAAQ,EAAE,CAAC;AACnD,CAAC"}
|
package/dist/environment.d.ts
CHANGED
|
@@ -63,6 +63,27 @@ export type Started = {
|
|
|
63
63
|
export declare function startScriptPath(repo: string, declared?: string): string | null;
|
|
64
64
|
export declare function hasStartScript(repo: string, declared?: string): boolean;
|
|
65
65
|
export declare function startEnvironment(repo: string, onStep: (text: string) => void, declared?: string): Promise<Started>;
|
|
66
|
+
/**
|
|
67
|
+
* Take a worktree's environment down: `start.sh down`, the same verb agents already call.
|
|
68
|
+
*
|
|
69
|
+
* Nothing used to. Every card a machine worked left its dev server and database running, and
|
|
70
|
+
* one build machine reached 106 node and 52 postgres processes, load 135 on 8 cores and 276 MB free —
|
|
71
|
+
* the pane froze for minutes at a time because the whole box was paging. A script that does not know
|
|
72
|
+
* `down` simply does nothing useful here, which is no worse than before.
|
|
73
|
+
*/
|
|
74
|
+
export declare function stopEnvironment(repo: string, declared?: string): Promise<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* On start, every card worktree's environment comes down, so a restarted agent begins with none.
|
|
77
|
+
*
|
|
78
|
+
* Whatever the last run left up belongs to no turn any more: the process that started it is gone,
|
|
79
|
+
* and the idle timer that would have stopped it went with it. The one exception is a worktree some
|
|
80
|
+
* OTHER agent's session is in right now — on a machine where several agents share a repo, their
|
|
81
|
+
* environments are theirs. Found by asking the OS which directories live `claude` processes are in,
|
|
82
|
+
* rather than trusting anybody's bookkeeping.
|
|
83
|
+
*
|
|
84
|
+
* Runs in the background and in sequence: it is cleanup, not something to make a start wait for.
|
|
85
|
+
*/
|
|
86
|
+
export declare function stopLeftoverEnvironments(repo: string, log: (text: string) => void): Promise<void>;
|
|
66
87
|
/**
|
|
67
88
|
* The JSON contract, if the script printed one. Fenced output is read first because a script that
|
|
68
89
|
* logs freely cannot be trusted to keep its JSON on one tidy line.
|
|
@@ -121,4 +142,4 @@ export declare function crossWired(endpoints: Record<string, string>, worktree:
|
|
|
121
142
|
* An agent with a running environment and no way to see it writes "verified by reading the code",
|
|
122
143
|
* which is not verification. An agent that HAS a browser and is not told so writes the same thing.
|
|
123
144
|
*/
|
|
124
|
-
export declare function browserBrief(
|
|
145
|
+
export declare function browserBrief(endpoints: Record<string, string>, sites?: Record<string, string>, forACard?: boolean): string;
|
package/dist/environment.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
-
import { existsSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { existsSync, readdirSync, realpathSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
/**
|
|
5
5
|
* Get the project running, if it has told us how.
|
|
@@ -73,6 +73,56 @@ export async function startEnvironment(repo, onStep, declared) {
|
|
|
73
73
|
...(contract ? { contract } : {}),
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Take a worktree's environment down: `start.sh down`, the same verb agents already call.
|
|
78
|
+
*
|
|
79
|
+
* Nothing used to. Every card a machine worked left its dev server and database running, and
|
|
80
|
+
* one build machine reached 106 node and 52 postgres processes, load 135 on 8 cores and 276 MB free —
|
|
81
|
+
* the pane froze for minutes at a time because the whole box was paging. A script that does not know
|
|
82
|
+
* `down` simply does nothing useful here, which is no worse than before.
|
|
83
|
+
*/
|
|
84
|
+
export async function stopEnvironment(repo, declared) {
|
|
85
|
+
const script = startScriptPath(repo, declared);
|
|
86
|
+
if (!script)
|
|
87
|
+
return false;
|
|
88
|
+
const { code } = await run(`bash ${script} down`, repo);
|
|
89
|
+
return code === 0;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* On start, every card worktree's environment comes down, so a restarted agent begins with none.
|
|
93
|
+
*
|
|
94
|
+
* Whatever the last run left up belongs to no turn any more: the process that started it is gone,
|
|
95
|
+
* and the idle timer that would have stopped it went with it. The one exception is a worktree some
|
|
96
|
+
* OTHER agent's session is in right now — on a machine where several agents share a repo, their
|
|
97
|
+
* environments are theirs. Found by asking the OS which directories live `claude` processes are in,
|
|
98
|
+
* rather than trusting anybody's bookkeeping.
|
|
99
|
+
*
|
|
100
|
+
* Runs in the background and in sequence: it is cleanup, not something to make a start wait for.
|
|
101
|
+
*/
|
|
102
|
+
export async function stopLeftoverEnvironments(repo, log) {
|
|
103
|
+
const root = join(repo, '..', `.worktrees-${repo.replace(/\/+$/, '').split('/').pop() || 'repo'}`);
|
|
104
|
+
if (!existsSync(root))
|
|
105
|
+
return;
|
|
106
|
+
const busy = await liveSessionDirs();
|
|
107
|
+
let stopped = 0;
|
|
108
|
+
for (const name of readdirSync(root)) {
|
|
109
|
+
const wt = join(root, name);
|
|
110
|
+
if (busy.some((d) => d === wt || d.startsWith(`${wt}/`)))
|
|
111
|
+
continue;
|
|
112
|
+
if (!existsSync(join(wt, START_SCRIPT)))
|
|
113
|
+
continue;
|
|
114
|
+
if (await stopEnvironment(wt).catch(() => false))
|
|
115
|
+
stopped++;
|
|
116
|
+
}
|
|
117
|
+
if (stopped)
|
|
118
|
+
log(`stopped ${stopped} environment(s) left running by an earlier run`);
|
|
119
|
+
}
|
|
120
|
+
/** Working directories of live `claude` processes — another agent's session, on a shared box. */
|
|
121
|
+
async function liveSessionDirs() {
|
|
122
|
+
// lsof works the same on Linux and macOS; -a ANDs the filters: cwd entries of processes named claude.
|
|
123
|
+
const { out } = await run('lsof -a -d cwd -c claude -Fn 2>/dev/null || true', '/');
|
|
124
|
+
return out.split('\n').filter((l) => l.startsWith('n/')).map((l) => l.slice(1));
|
|
125
|
+
}
|
|
76
126
|
/**
|
|
77
127
|
* The JSON contract, if the script printed one. Fenced output is read first because a script that
|
|
78
128
|
* logs freely cannot be trusted to keep its JSON on one tidy line.
|
|
@@ -231,6 +281,17 @@ function run(command, cwd) {
|
|
|
231
281
|
export function notStartedBrief(skipped, repo) {
|
|
232
282
|
if (!skipped)
|
|
233
283
|
return '';
|
|
284
|
+
// Telling an agent to run a file that is not in the checkout is the harness lying to it, and it
|
|
285
|
+
// costs a turn: it runs the line, gets "No such file", and has nothing to go on.
|
|
286
|
+
if (!hasStartScript(repo)) {
|
|
287
|
+
return (`\n\nThe project is NOT running, and this project has no ${START_SCRIPT} to start it with. ` +
|
|
288
|
+
`For most cards that changes nothing: reading the code and running the project's own checks ` +
|
|
289
|
+
`— a typecheck, a lint, a verify script — is both faster and better evidence.\n\n` +
|
|
290
|
+
`If this card genuinely needs the project up, writing ${START_SCRIPT} is yours to do and ` +
|
|
291
|
+
`worth doing once. It brings the project up on a FREE port — several worktrees run at once ` +
|
|
292
|
+
`— prints a \`name=url\` line for each part it started, and exits. Commit it with your ` +
|
|
293
|
+
`change and every card after this one gets a running project and a browser for free.`);
|
|
294
|
+
}
|
|
234
295
|
return (`\n\nThe project is NOT running. This card did not look like one that needs it, so nothing ` +
|
|
235
296
|
`was started and you have your checkout and the code. Do not start it out of habit: for a ` +
|
|
236
297
|
`small change, reading the code and the project's own checks (a typecheck, a lint, a verify ` +
|
|
@@ -357,14 +418,40 @@ async function listenerCwd(port) {
|
|
|
357
418
|
* An agent with a running environment and no way to see it writes "verified by reading the code",
|
|
358
419
|
* which is not verification. An agent that HAS a browser and is not told so writes the same thing.
|
|
359
420
|
*/
|
|
360
|
-
export function browserBrief(
|
|
361
|
-
if (!
|
|
421
|
+
export function browserBrief(endpoints, sites = {}, forACard = true) {
|
|
422
|
+
if (!forACard)
|
|
362
423
|
return '';
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
424
|
+
const running = Object.keys(endpoints);
|
|
425
|
+
const deployed = Object.entries(sites).filter(([k]) => !endpoints[k]);
|
|
426
|
+
const part = endpoints['ui'] ? 'ui' : running[0] ?? Object.keys(sites)[0] ?? 'ui';
|
|
427
|
+
// Nothing to look at yet. Worth saying anyway: an agent told nothing assumes it has no eyes,
|
|
428
|
+
// and the one thing that would give it eyes is a file it is perfectly able to write.
|
|
429
|
+
if (!running.length && !deployed.length) {
|
|
430
|
+
return (`\n\nThis machine has a real browser — \`open_page\`, \`look\`, \`click\`, \`fill\`, ` +
|
|
431
|
+
`\`screenshot\` — and right now nothing to point it at: this project has no ` +
|
|
432
|
+
`${START_SCRIPT} and the board declared no deployed site.\n\n` +
|
|
433
|
+
`If the card needs to be SEEN, you can fix that yourself rather than report it. Write ` +
|
|
434
|
+
`${START_SCRIPT}: bring the project up on a free port, print \`name=url\` for each part it ` +
|
|
435
|
+
`started, and exit. One file, committed, and every future card on this board opens a ` +
|
|
436
|
+
`browser without asking anyone. Then start it detached and pass the \`url\` it printed to ` +
|
|
437
|
+
`\`open_page\` for this turn.`);
|
|
438
|
+
}
|
|
439
|
+
const where = running.length
|
|
440
|
+
? `\`open_page\` takes the NAME of a part — \`${part}\` — not a port, because every worktree ` +
|
|
441
|
+
`runs on different ones.`
|
|
442
|
+
: `\`open_page\` takes the NAME of a site the board declared: ${deployed.map(([k]) => `\`${k}\``).join(', ')}.`;
|
|
443
|
+
return (`\n\nYou can look at this with a real browser. ${where} It gives you the page as a list of ` +
|
|
444
|
+
`what is on it, by role and name; click and fill take those same names, so you never write a ` +
|
|
445
|
+
`selector.\n\n` +
|
|
446
|
+
(deployed.length && running.length
|
|
447
|
+
? `Two different things are reachable, and they answer different questions. ` +
|
|
448
|
+
`\`${part}\` is YOUR code, with your change in it. ` +
|
|
449
|
+
`${deployed.map(([k]) => `\`${k}\``).join(', ')} is what is already deployed, without it — ` +
|
|
450
|
+
`so when something looks wrong, opening both tells you whether you caused it.\n\n`
|
|
451
|
+
: deployed.length
|
|
452
|
+
? `This is the DEPLOYED site, which does not have your change in it. It tells you how the ` +
|
|
453
|
+
`card behaves today, which is what to compare against once your change is live.\n\n`
|
|
454
|
+
: '') +
|
|
368
455
|
`Use it when a card is about something a person SEES — layout, wording, whether a control ` +
|
|
369
456
|
`works. For anything else the project's own checks are faster and better evidence. If the ` +
|
|
370
457
|
`card asks for a picture, \`screenshot\` saves one in your checkout to attach.\n\n` +
|