@augurworks/augur 0.15.5 → 0.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/README.md +5 -3
- package/package.json +1 -1
- package/scripts/lib/store.mjs +21 -1
- package/src/_worker.js +5 -3
package/agents/README.md
CHANGED
|
@@ -32,9 +32,11 @@ signed in to and types the code; the token lands in `~/.config/augur/tokens.json
|
|
|
32
32
|
`augur ship` / `augur publish` use it from then on. `publish` runs the pairing itself when
|
|
33
33
|
it finds no token, so inside a workspace tree nothing has to be done first. On a workspace
|
|
34
34
|
that serves drafts (`/.well-known/augur.json` says `drafts.enabled`), the everyday verbs
|
|
35
|
-
are `augur open` and `augur land` instead — see [drafts.md](./drafts.md).
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
are `augur open` and `augur land` instead — see [drafts.md](./drafts.md). Where drafts
|
|
36
|
+
are served you need no tree at all: `augur open <opportunity>/<prototype>` fetches that one
|
|
37
|
+
prototype into a folder of its own (a cold agent that cloned a large workspace first spent
|
|
38
|
+
most of its first turn waiting). Elsewhere, `npx @augurworks/augur clone --space <id>` fetches
|
|
39
|
+
the tree — it reads the origin from the pairing.
|
|
38
40
|
|
|
39
41
|
The instance says all of this itself at `GET /llms.txt` (and as data at
|
|
40
42
|
`/.well-known/augur.json`); a signed-out request for an engine path answers `401` with
|
package/package.json
CHANGED
package/scripts/lib/store.mjs
CHANGED
|
@@ -39,10 +39,30 @@ export function resolveOrigin(root = ENGINE_ROOT) {
|
|
|
39
39
|
cwdSpaceOrigin = JSON.parse(readFileSync(path.join(process.cwd(), "space.json"), "utf8")).siteOrigin || "";
|
|
40
40
|
} catch (e) {}
|
|
41
41
|
return (process.env.AUGUR_ORIGIN || env.AUGUR_ORIGIN ||
|
|
42
|
-
deployConfig(root, originHost(cwdSpaceOrigin)).siteOrigin || cwdSpaceOrigin || "")
|
|
42
|
+
deployConfig(root, originHost(cwdSpaceOrigin)).siteOrigin || cwdSpaceOrigin || pairedOrigin() || "")
|
|
43
43
|
.replace(/\/+$/, "");
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* The origin this machine last paired with, when nothing else names one. A cold agent
|
|
48
|
+
* in an empty folder has just run `augur connect --origin X` and holds a token for X and
|
|
49
|
+
* nothing else — and `clone`/`open` then refused with "no target origin" until it typed
|
|
50
|
+
* AUGUR_ORIGIN, which the front door had told it the pairing would carry. One saved
|
|
51
|
+
* pairing is the answer; several is the most recent, said on stderr so a wrong guess is
|
|
52
|
+
* visible before anything is written.
|
|
53
|
+
*/
|
|
54
|
+
export function pairedOrigin() {
|
|
55
|
+
try {
|
|
56
|
+
const saved = JSON.parse(readFileSync(path.join(os.homedir(), ".config", "augur", "tokens.json"), "utf8"));
|
|
57
|
+
const hosts = Object.entries(saved).filter(([h, v]) => h && v && v.token);
|
|
58
|
+
if (!hosts.length) return "";
|
|
59
|
+
hosts.sort((a, b) => String(b[1].at || "").localeCompare(String(a[1].at || "")));
|
|
60
|
+
const [host] = hosts[0];
|
|
61
|
+
if (hosts.length > 1) console.error(`[augur] no origin named — using the last pairing, https://${host} (set AUGUR_ORIGIN to pick another)`);
|
|
62
|
+
return `https://${host}`;
|
|
63
|
+
} catch (e) { return ""; }
|
|
64
|
+
}
|
|
65
|
+
|
|
46
66
|
export function resolveToken(origin, root = ENGINE_ROOT) {
|
|
47
67
|
const env = readEnvFile(path.join(root, ".env.deploy"));
|
|
48
68
|
let token = process.env.AUGUR_TOKEN || env.AUGUR_TOKEN || "";
|
package/src/_worker.js
CHANGED
|
@@ -9139,9 +9139,11 @@ function doorText(f) {
|
|
|
9139
9139
|
+ `turn, and run the same command again once they say they approved — the token is\n`
|
|
9140
9140
|
+ `collected then, for that same code. Do not poll for the approval in one turn:\n`
|
|
9141
9141
|
+ `the code lives five minutes and nobody sees it until you stop.\n\n`
|
|
9142
|
-
+
|
|
9143
|
-
|
|
9144
|
-
|
|
9142
|
+
+ (f.drafts && f.drafts.enabled
|
|
9143
|
+
? `You need no source tree here: \`augur open <opportunity>/<prototype>\` fetches that one\n`
|
|
9144
|
+
+ `prototype into a folder of its own (see below). Do not clone the workspace first.\n\n`
|
|
9145
|
+
: `With no source tree yet, \`npx @augurworks/augur clone --space ${f.workspace}\` then fetches\n`
|
|
9146
|
+
+ `one (it reads the origin from the pairing).\n\n`)
|
|
9145
9147
|
: `Device pairing is switched off on this workspace. Ask an admin for an invite;\n`
|
|
9146
9148
|
+ `once you have signed in, \`augur login\` (email and password, meant for CI)\n`
|
|
9147
9149
|
+ `trades that for a publish token.\n\n`;
|