@clawtrail/init 2.5.0 → 2.5.1

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.
Files changed (2) hide show
  1. package/dist/index.js +44 -31
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -98,27 +98,7 @@ async function downloadSkillFiles(targetDir, staging = false) {
98
98
  return { succeeded, failed };
99
99
  }
100
100
  async function installContextGraph(staging, agentId, apiKey) {
101
- const spinner = ora("Installing context-graph packages...").start();
102
- try {
103
- execSync(
104
- "npm install -g @clawtrail/context-graph @clawtrail/context-graph-openclaw",
105
- { stdio: "pipe", timeout: 12e4 }
106
- );
107
- } catch (err) {
108
- try {
109
- execSync(
110
- "npm install @clawtrail/context-graph @clawtrail/context-graph-openclaw",
111
- { stdio: "pipe", timeout: 12e4 }
112
- );
113
- } catch {
114
- spinner.warn(
115
- chalk.yellow(
116
- "Could not install context-graph packages \u2014 install manually:\n npm install @clawtrail/context-graph @clawtrail/context-graph-openclaw"
117
- )
118
- );
119
- return { installed: false, configPath: null, error: err.message };
120
- }
121
- }
101
+ const spinner = ora("Setting up context-graph provenance...").start();
122
102
  const openclawDir = path.join(os.homedir(), ".openclaw");
123
103
  const pluginDir = path.join(openclawDir, "plugins", "context-graph");
124
104
  await ensureDirectory(pluginDir);
@@ -153,14 +133,41 @@ async function installContextGraph(staging, agentId, apiKey) {
153
133
  );
154
134
  } catch {
155
135
  }
156
- spinner.succeed(
157
- chalk.green(
158
- `Context-graph installed \u2192 auto-submit to ${staging ? "staging" : "production"}`
159
- )
160
- );
136
+ let packagesInstalled = false;
137
+ try {
138
+ execSync(
139
+ `npm install --prefix "${pluginDir}" @clawtrail/context-graph @clawtrail/context-graph-openclaw`,
140
+ { stdio: "pipe", timeout: 12e4 }
141
+ );
142
+ packagesInstalled = true;
143
+ } catch {
144
+ try {
145
+ execSync(
146
+ "npm install -g @clawtrail/context-graph @clawtrail/context-graph-openclaw",
147
+ { stdio: "pipe", timeout: 12e4 }
148
+ );
149
+ packagesInstalled = true;
150
+ } catch {
151
+ }
152
+ }
153
+ if (packagesInstalled) {
154
+ spinner.succeed(
155
+ chalk.green(
156
+ `Context-graph configured \u2192 auto-submit to ${staging ? "staging" : "production"}`
157
+ )
158
+ );
159
+ } else {
160
+ spinner.warn(
161
+ chalk.yellow(
162
+ `Context-graph configured but packages not installed \u2014 run manually:
163
+ npm install -g @clawtrail/context-graph @clawtrail/context-graph-openclaw`
164
+ )
165
+ );
166
+ }
161
167
  return {
162
168
  installed: true,
163
- configPath: "~/.openclaw/plugins/context-graph/config.json"
169
+ configPath: "~/.openclaw/plugins/context-graph/config.json",
170
+ packagesInstalled
164
171
  };
165
172
  }
166
173
  async function configureOpenClaw(staging, apiKey) {
@@ -467,7 +474,7 @@ async function main() {
467
474
  const program = new Command();
468
475
  program.name("clawtrail-init").description(
469
476
  "Install ClawTrail skill files, configure heartbeat, and optionally register an agent"
470
- ).version("2.5.0").option(
477
+ ).version("2.5.1").option(
471
478
  "-d, --dir <path>",
472
479
  "Download directory for skill files",
473
480
  "./clawtrail-skills"
@@ -670,9 +677,15 @@ CLAWTRAIL_API_KEY=${apiKey}
670
677
  );
671
678
  }
672
679
  if (cgResult?.installed) {
673
- console.log(
674
- chalk.white(" Provenance: ") + chalk.green("context-graph installed (auto-submit enabled)")
675
- );
680
+ if (cgResult.packagesInstalled) {
681
+ console.log(
682
+ chalk.white(" Provenance: ") + chalk.green("context-graph installed (auto-submit enabled)")
683
+ );
684
+ } else {
685
+ console.log(
686
+ chalk.white(" Provenance: ") + chalk.yellow("configured (packages need manual install)")
687
+ );
688
+ }
676
689
  if (cgResult.configPath) {
677
690
  console.log(
678
691
  chalk.white(" CG config: ") + chalk.cyan(cgResult.configPath)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawtrail/init",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "CLI installer for ClawTrail AI agent skill files",
5
5
  "main": "dist/index.js",
6
6
  "bin": {