create-open-autonomy 2.4.1 → 2.4.2
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/package.json +1 -1
- package/src/kit.ts +1 -1
- package/template/.open-autonomy/start.ts +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-open-autonomy",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "The default Open Autonomy starter kit: a complete repository that runs its own Hermes agent against the platform, with the SDK wired in. `bun create open-autonomy <dir>` scaffolds one.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
package/src/kit.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
10
10
|
import { dirname, join, relative, resolve } from 'node:path';
|
|
11
11
|
|
|
12
|
-
export const KIT = { name: 'hermes', version: '2.4.
|
|
12
|
+
export const KIT = { name: 'hermes', version: '2.4.2' } as const;
|
|
13
13
|
export const KIT_FILE = '.open-autonomy/kit.json';
|
|
14
14
|
const TEMPLATE = resolve(import.meta.dir, '..', 'template');
|
|
15
15
|
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
// The processes, in order:
|
|
20
20
|
// ssh-agent holds <secrets>/deploy_key, its socket at <home>/ssh-agent.sock; the gateway pushes through it
|
|
21
21
|
// and never holds the key (absent: pushes are your own git's business)
|
|
22
|
-
// the clone <project> cloned from --origin when it is not a checkout yet (a container's first boot)
|
|
22
|
+
// the clone <project> cloned from --origin when it is not a checkout yet (a container's first boot); a clean
|
|
23
|
+
// checkout is brought to origin/main on every start, so the agent is what the repository says today
|
|
23
24
|
// the home hermes/ in the checkout copied into <home> before every start — the repository is the source of
|
|
24
25
|
// truth for what the agent IS; the home keeps what it has since done (its .env is kept)
|
|
25
26
|
// valve <secrets>/agent.env on :8787 (the developer's key), <secrets>/treasurer.env on :8788 (the
|
|
@@ -87,6 +88,16 @@ if (!existsSync(resolve(project, '.git'))) {
|
|
|
87
88
|
const clone = Bun.spawnSync({ cmd: drop(['git', 'clone', '-q', origin, project]), env: agentEnv(), stdout: 'inherit', stderr: 'inherit' });
|
|
88
89
|
if (clone.exitCode !== 0) { console.error(`start: cannot clone ${origin}`); process.exit(1); }
|
|
89
90
|
say(`cloned ${origin} → ${project}`);
|
|
91
|
+
} else {
|
|
92
|
+
// What the agent IS is what main says: a clean checkout moves to origin/main before the home is synced from it
|
|
93
|
+
// (the skills, the schedule, the documents the reporter publishes). A dirty one — a killed attempt's work — is
|
|
94
|
+
// left as it is; the next attempt starts from a fresh main itself. A fetch that fails (no network, a world) is
|
|
95
|
+
// said and not fatal.
|
|
96
|
+
const git = (...args: string[]) => Bun.spawnSync({ cmd: drop(['git', ...args]), cwd: project, env: agentEnv(), stdout: 'pipe', stderr: 'pipe' });
|
|
97
|
+
const dirty = git('status', '--porcelain').stdout.toString().trim();
|
|
98
|
+
if (dirty) say(`checkout ${project} has uncommitted changes; left where it is`);
|
|
99
|
+
else if (git('fetch', '-q', 'origin').exitCode !== 0) say(`cannot fetch origin in ${project}; left where it is`);
|
|
100
|
+
else if (git('checkout', '-q', '--detach', 'origin/main').exitCode === 0) say(`checkout ${project} at origin/main (${git('rev-parse', '--short', 'HEAD').stdout.toString().trim()})`);
|
|
90
101
|
}
|
|
91
102
|
|
|
92
103
|
// 3. The home, from the checkout: everything under hermes/ except its .env, which is the home's own.
|