@byokit/herdr 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +29 -13
- package/dist/accounts.d.ts +2 -1
- package/dist/accounts.js +34 -29
- package/dist/agents.d.ts +3 -2
- package/dist/agents.js +98 -30
- package/dist/close.js +15 -6
- package/dist/constants.js +1 -1
- package/dist/device.d.ts +19 -1
- package/dist/device.js +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/kit.d.ts +3 -0
- package/dist/kit.js +3 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.js +139 -5
- package/dist/muse.d.ts +2 -0
- package/dist/muse.js +7 -1
- package/dist/notices.js +10 -16
- package/dist/testing/contract.js +138 -4
- package/dist/testing/fake-herdr/server.js +61 -1
- package/dist/turn-files.d.ts +1 -1
- package/dist/turn-files.js +6 -1
- package/dist/turns.js +7 -5
- package/dist/types.d.ts +8 -2
- package/dist/words.json +1 -0
- package/package.json +5 -5
package/dist/turns.js
CHANGED
|
@@ -73,9 +73,11 @@ export function createTurns(kit) {
|
|
|
73
73
|
if (!isAbsolute(o.cwd))
|
|
74
74
|
throw fail('turn-cwd');
|
|
75
75
|
const timeoutMs = positiveLimit(o.timeoutMs, 300000);
|
|
76
|
-
// Fail invalid configuration before delivering a prompt.
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
// Fail invalid configuration before delivering a prompt (no scan means no file limits to check).
|
|
77
|
+
if (o.files !== false) {
|
|
78
|
+
positiveLimit(o.files?.maxFiles, 10000);
|
|
79
|
+
positiveLimit(o.files?.maxBytes, 128 * 1024 * 1024);
|
|
80
|
+
}
|
|
79
81
|
if (o.result)
|
|
80
82
|
positiveLimit(o.result.maxBytes, 1024 * 1024);
|
|
81
83
|
const schema = o.result ? JSON.stringify(o.result.schema) : undefined;
|
|
@@ -125,7 +127,7 @@ export function createTurns(kit) {
|
|
|
125
127
|
const endSignal = new Promise((resolve) => { resolveEnd = resolve; });
|
|
126
128
|
const watch = kit.subscribe([{ type: 'pane.agent_status_changed', pane_id: target.paneId }], (e) => {
|
|
127
129
|
if (!armed) {
|
|
128
|
-
if (e.agent_status !== 'idle')
|
|
130
|
+
if (e.agent_status !== 'idle' && e.agent_status !== 'done')
|
|
129
131
|
abort('turn-busy');
|
|
130
132
|
return;
|
|
131
133
|
}
|
|
@@ -153,7 +155,7 @@ export function createTurns(kit) {
|
|
|
153
155
|
throw fail('turn-watch-lost');
|
|
154
156
|
const beforeAgent = await gate(kit.call('agent.get', { target: target.paneId }));
|
|
155
157
|
const agent = beforeAgent.agent;
|
|
156
|
-
if (agent.agent_status !== 'idle' || agent.launch_pending === true)
|
|
158
|
+
if ((agent.agent_status !== 'idle' && agent.agent_status !== 'done') || agent.launch_pending === true)
|
|
157
159
|
throw fail('turn-not-idle');
|
|
158
160
|
if (target.name && agent.name !== target.name)
|
|
159
161
|
throw fail('turn-unavailable');
|
package/dist/types.d.ts
CHANGED
|
@@ -98,6 +98,7 @@ export type AgentStartEvent = {
|
|
|
98
98
|
export type AgentRef = {
|
|
99
99
|
paneId: string;
|
|
100
100
|
name?: string;
|
|
101
|
+
created?: boolean;
|
|
101
102
|
};
|
|
102
103
|
export type StartAgent = {
|
|
103
104
|
kind: string;
|
|
@@ -106,6 +107,9 @@ export type StartAgent = {
|
|
|
106
107
|
place: {
|
|
107
108
|
workspace: 'new';
|
|
108
109
|
label?: string;
|
|
110
|
+
} | {
|
|
111
|
+
workspace: string;
|
|
112
|
+
label?: string;
|
|
109
113
|
} | {
|
|
110
114
|
tab: 'new';
|
|
111
115
|
workspaceId: string;
|
|
@@ -155,6 +159,7 @@ export type MoveToAccount = {
|
|
|
155
159
|
provider: string;
|
|
156
160
|
folder: string;
|
|
157
161
|
env?: Record<string, string>;
|
|
162
|
+
name?: string;
|
|
158
163
|
direction?: 'right' | 'down';
|
|
159
164
|
timeoutMs?: number;
|
|
160
165
|
whenBusy?: BusyHandoff;
|
|
@@ -164,7 +169,7 @@ export type MoveToAccountResult = {
|
|
|
164
169
|
session: string;
|
|
165
170
|
} | {
|
|
166
171
|
ok: false;
|
|
167
|
-
code: 'too_early' | 'busy' | 'unsupported' | 'env_mismatch' | 'close_failed' | 'start_failed' | 'blocked' | 'changed' | 'interrupt_unsupported';
|
|
172
|
+
code: 'too_early' | 'busy' | 'unsupported' | 'env_mismatch' | 'close_failed' | 'start_failed' | 'blocked' | 'changed' | 'interrupt_unsupported' | 'signed_out';
|
|
168
173
|
message: string;
|
|
169
174
|
live?: string;
|
|
170
175
|
};
|
|
@@ -209,7 +214,8 @@ export type AgentTurnOptions<T = unknown> = {
|
|
|
209
214
|
cwd: string;
|
|
210
215
|
timeoutMs?: number;
|
|
211
216
|
signal?: AbortSignal;
|
|
212
|
-
|
|
217
|
+
/** Pass false to skip the file scan entirely (changedFiles is then always empty). */
|
|
218
|
+
files?: AgentTurnFiles | false;
|
|
213
219
|
result?: AgentTurnResultPolicy<T>;
|
|
214
220
|
onEnd?: (end: AgentTurnEnd<T>) => void;
|
|
215
221
|
};
|
package/dist/words.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"approval.stale": "That question already changed. Look again before answering.",
|
|
21
21
|
"close.wouldWiden": "Closing this would close more than you picked. Close the bigger one instead.",
|
|
22
22
|
"link.notAllowed": "This device can't do that. Ask the person at the computer.",
|
|
23
|
+
"move.signed_out": "Sign in to {name} first.",
|
|
23
24
|
"move.too_early": "This conversation has not started yet. Try again in a moment.",
|
|
24
25
|
"move.busy": "Wait for this conversation to finish before moving it.",
|
|
25
26
|
"move.unsupported": "This conversation cannot move between these accounts.",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byokit/herdr",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Drive the Herdr on this computer — workspaces, tabs, panes, agents and blocked-approval answers — from an app, or hand it to a phone over @byokit/
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Drive the Herdr on this computer — workspaces, tabs, panes, agents and blocked-approval answers — from an app, or hand it to a phone over @byokit/pair.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"prepack": "tsc -b && node ../../scripts/fix-words-dts.cjs"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@byokit/
|
|
56
|
-
"@byokit/relay": "0.6.
|
|
57
|
-
"@byokit/discover": "0.
|
|
55
|
+
"@byokit/pair": "0.10.0",
|
|
56
|
+
"@byokit/relay": "0.6.1",
|
|
57
|
+
"@byokit/discover": "0.8.0",
|
|
58
58
|
"@byokit/seal": "0.3.0",
|
|
59
59
|
"ws": "8.22.0"
|
|
60
60
|
},
|