@peakflo/agent-harness 0.2.11-rc.4 → 0.2.11-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/cli.js +2 -1
- package/dist/connect/connect.d.ts +3 -2
- package/dist/connect/connect.js +8 -6
- package/dist/harness.js +1 -1
- package/dist/service.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,7 +54,8 @@ Optional flags include `--health-port <port>`, `--runtime <desktop|self-hosted>`
|
|
|
54
54
|
|
|
55
55
|
## Connect your own agent in one command
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Agents → "Connect your own agent" in Spaces (and the Welcome window during
|
|
58
|
+
onboarding) shows one command for Codex, Claude Code, or
|
|
58
59
|
Cursor, for example:
|
|
59
60
|
|
|
60
61
|
```sh
|
|
@@ -129,7 +130,8 @@ New service files start with `--service --stored-credential`. Older service
|
|
|
129
130
|
files with only `--stored-credential` still work after an upgrade. Run
|
|
130
131
|
`service repair` to update the file. The runner reads its saved credential
|
|
131
132
|
from the workspace. If that credential is missing, expired, or
|
|
132
|
-
rejected,
|
|
133
|
+
rejected, open Agents → "Connect your own agent" in Spaces (or "Reconnect" on
|
|
134
|
+
that machine) to get a new command, and run it on the machine. The service
|
|
133
135
|
file and the service settings contain no enrolment token or runner credential.
|
|
134
136
|
It stops after an invalid option, a refused harness version, an unusable
|
|
135
137
|
credential, or a local port conflict. Linux waits 30 seconds before it retries
|
package/dist/cli.js
CHANGED
|
@@ -46,7 +46,8 @@ const USAGE = `pf-agent-harness — headless Peakflo coding-agent harness
|
|
|
46
46
|
|
|
47
47
|
Usage:
|
|
48
48
|
pf-agent-harness connect <codex|claude-code|cursor> --connection <id> [--control-plane <url>]
|
|
49
|
-
one command from
|
|
49
|
+
one command from Agents → "Connect your own
|
|
50
|
+
agent" in Spaces (or the Welcome window): approve
|
|
50
51
|
this computer in the browser, connect the agent
|
|
51
52
|
as your personal agent, run it in the background
|
|
52
53
|
pf-agent-harness start [options]
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `pf-agent-harness connect <vendor> --connection <id> [--control-plane <url>]`
|
|
3
3
|
*
|
|
4
|
-
* ONE COMMAND, copied from
|
|
4
|
+
* ONE COMMAND, copied from Agents → "Connect your own agent" (or the
|
|
5
|
+
* Welcome window), that:
|
|
5
6
|
* 1. checks the vendor CLI is installed and signed in;
|
|
6
7
|
* 2. asks the signed-in user to approve this computer in the browser
|
|
7
8
|
* (loopback + PKCE + `state`; see workflow-api `byo-connect.ts`);
|
|
@@ -34,7 +35,7 @@ export interface ConnectArgs {
|
|
|
34
35
|
appUrl?: string;
|
|
35
36
|
openBrowser: boolean;
|
|
36
37
|
}
|
|
37
|
-
export declare const CONNECT_USAGE = "Usage: pf-agent-harness connect <codex|claude-code|cursor> --connection <id> [--control-plane <url>]\n\nCopy this command from
|
|
38
|
+
export declare const CONNECT_USAGE = "Usage: pf-agent-harness connect <codex|claude-code|cursor> --connection <id> [--control-plane <url>]\n\nCopy this command from Agents \u2192 \"Connect your own agent\" in Spaces (or\n\"Reconnect\" on your machine there). It approves this computer\nin your browser, connects the agent as your personal agent, and keeps it\nrunning in the background.";
|
|
38
39
|
export declare function parseConnectArgs(argv: string[], env?: NodeJS.ProcessEnv): ConnectArgs;
|
|
39
40
|
/** The machine name the approval page shows. Must match the API's rule. */
|
|
40
41
|
export declare function machineName(raw: string): string;
|
package/dist/connect/connect.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* `pf-agent-harness connect <vendor> --connection <id> [--control-plane <url>]`
|
|
4
4
|
*
|
|
5
|
-
* ONE COMMAND, copied from
|
|
5
|
+
* ONE COMMAND, copied from Agents → "Connect your own agent" (or the
|
|
6
|
+
* Welcome window), that:
|
|
6
7
|
* 1. checks the vendor CLI is installed and signed in;
|
|
7
8
|
* 2. asks the signed-in user to approve this computer in the browser
|
|
8
9
|
* (loopback + PKCE + `state`; see workflow-api `byo-connect.ts`);
|
|
@@ -74,7 +75,8 @@ exports.VENDOR_SETUP = {
|
|
|
74
75
|
};
|
|
75
76
|
exports.CONNECT_USAGE = `Usage: pf-agent-harness connect <codex|claude-code|cursor> --connection <id> [--control-plane <url>]
|
|
76
77
|
|
|
77
|
-
Copy this command from
|
|
78
|
+
Copy this command from Agents → "Connect your own agent" in Spaces (or
|
|
79
|
+
"Reconnect" on your machine there). It approves this computer
|
|
78
80
|
in your browser, connects the agent as your personal agent, and keeps it
|
|
79
81
|
running in the background.`;
|
|
80
82
|
function flag(argv, name) {
|
|
@@ -124,7 +126,7 @@ function parseConnectArgs(argv, env = {}) {
|
|
|
124
126
|
// `--token` is refused on purpose: this command never takes a secret.
|
|
125
127
|
const connection = flag(argv, 'connection');
|
|
126
128
|
if (!connection || !UUID.test(connection))
|
|
127
|
-
throw new ConnectError(`Copy the command from
|
|
129
|
+
throw new ConnectError(`Copy the command from Agents → "Connect your own agent" in Spaces: it includes --connection <id>.\n\n${exports.CONNECT_USAGE}`);
|
|
128
130
|
const appUrl = flag(argv, 'app-url') ?? env.PF_APP_URL;
|
|
129
131
|
return {
|
|
130
132
|
vendor,
|
|
@@ -205,7 +207,7 @@ async function runConnect(args, deps) {
|
|
|
205
207
|
const setup = exports.VENDOR_SETUP[vendor];
|
|
206
208
|
const log = deps.log;
|
|
207
209
|
if (deps.platform !== 'darwin' && deps.platform !== 'linux')
|
|
208
|
-
throw new ConnectError('connect needs macOS or Linux. On Windows, use "Ask my agent to do it"
|
|
210
|
+
throw new ConnectError('connect needs macOS or Linux. On Windows, open Agents → "Connect your own agent" in Spaces and use "Ask my agent to do it instead".');
|
|
209
211
|
const machine = machineName(deps.hostname());
|
|
210
212
|
log(`Connecting ${setup.label} on ${machine}…`);
|
|
211
213
|
/* 1. The vendor CLI must be installed and signed in. */
|
|
@@ -265,7 +267,7 @@ async function runConnect(args, deps) {
|
|
|
265
267
|
exchange.json.vendor !== vendor)
|
|
266
268
|
throw new ConnectError(typeof exchange.json.error === 'string'
|
|
267
269
|
? printable(exchange.json.error)
|
|
268
|
-
: `The approval could not be used (${exchange.status}).
|
|
270
|
+
: `The approval could not be used (${exchange.status}). Open Agents → "Connect your own agent" in Spaces (or "Reconnect" on this machine) to get a new command.`);
|
|
269
271
|
const company = typeof exchange.json.companyName === 'string'
|
|
270
272
|
? exchange.json.companyName
|
|
271
273
|
: 'your company';
|
|
@@ -301,7 +303,7 @@ async function runConnect(args, deps) {
|
|
|
301
303
|
if (!healthy)
|
|
302
304
|
log(`! The service has not answered yet (it may still be starting, or a local port was taken). Check it with: npx @peakflo/agent-harness service status --vendor ${vendor}`);
|
|
303
305
|
log('');
|
|
304
|
-
log(`✓ ${setup.label} is connected to ${company} on ${machine}. Return to
|
|
306
|
+
log(`✓ ${setup.label} is connected to ${company} on ${machine}. Return to Spaces.`);
|
|
305
307
|
}
|
|
306
308
|
/* -------------------------------------------------------------------------- */
|
|
307
309
|
/* Real dependencies */
|
package/dist/harness.js
CHANGED
|
@@ -116,7 +116,7 @@ exports.VersionRefusedError = VersionRefusedError;
|
|
|
116
116
|
/** A service cannot re-enrol without a new one-time token from a user. */
|
|
117
117
|
class StoredCredentialUnavailableError extends Error {
|
|
118
118
|
constructor() {
|
|
119
|
-
super('No usable stored runner credential.
|
|
119
|
+
super('No usable stored runner credential. For your own agent, open Agents in Spaces and use "Reconnect" on this machine (or "Connect your own agent") to get a new command, then run it here. For a self-hosted runner, start it once in a terminal to sign in again.');
|
|
120
120
|
this.name = 'StoredCredentialUnavailableError';
|
|
121
121
|
}
|
|
122
122
|
}
|
package/dist/service.js
CHANGED
|
@@ -305,7 +305,7 @@ class ServiceManager {
|
|
|
305
305
|
if (!stored ||
|
|
306
306
|
(stored.credentialExpiresAt &&
|
|
307
307
|
Date.parse(stored.credentialExpiresAt) <= Date.now())) {
|
|
308
|
-
throw new Error('No usable saved runner credential.
|
|
308
|
+
throw new Error('No usable saved runner credential. For your own agent, open Agents in Spaces and use "Reconnect" on this machine (or "Connect your own agent") to get a new command, then run it here. For a self-hosted runner, start it once in a terminal to sign in again.');
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
writeAndStart(config) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peakflo/agent-harness",
|
|
3
|
-
"version": "0.2.11-rc.
|
|
3
|
+
"version": "0.2.11-rc.5",
|
|
4
4
|
"description": "Headless Peakflo coding-agent harness. One codebase, three hosting modes: a Daytona cloud sandbox, a customer VM, and the 20x desktop.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|