@jive-ai/cli 0.0.37 → 0.0.38

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.mjs +26 -12
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -3430,7 +3430,7 @@ async function createGraphQLClient() {
3430
3430
 
3431
3431
  //#endregion
3432
3432
  //#region package.json
3433
- var version = "0.0.37";
3433
+ var version = "0.0.38";
3434
3434
 
3435
3435
  //#endregion
3436
3436
  //#region src/runner/index.ts
@@ -5133,18 +5133,32 @@ async function setupRunnerCommand(options) {
5133
5133
  let config = null;
5134
5134
  const runnerConfigPath = path.join(process.env.HOME || process.env.USERPROFILE || "", ".jive", "runner.json");
5135
5135
  async function getRunnerConfig() {
5136
- if (process.env.JIVE_RUNNER_ID && process.env.JIVE_TEAM_ID) return {
5137
- id: parseInt(process.env.JIVE_RUNNER_ID),
5138
- name: process.env.JIVE_RUNNER_NAME || "docker-runner",
5139
- type: "docker",
5140
- teamId: process.env.JIVE_TEAM_ID,
5141
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
5142
- };
5143
5136
  if (config) return config;
5144
- const configData = await fs.readFile(runnerConfigPath, "utf-8");
5145
- config = JSON.parse(configData);
5146
- if (!config) throw new Error("Failed to load runner config");
5147
- return config;
5137
+ let fileConfig = null;
5138
+ try {
5139
+ const configData = await fs.readFile(runnerConfigPath, "utf-8");
5140
+ fileConfig = JSON.parse(configData);
5141
+ } catch {}
5142
+ if (fileConfig) {
5143
+ config = {
5144
+ ...fileConfig,
5145
+ ...process.env.JIVE_RUNNER_ID && { id: parseInt(process.env.JIVE_RUNNER_ID) },
5146
+ ...process.env.JIVE_RUNNER_NAME && { name: process.env.JIVE_RUNNER_NAME },
5147
+ ...process.env.JIVE_TEAM_ID && { teamId: process.env.JIVE_TEAM_ID }
5148
+ };
5149
+ return config;
5150
+ }
5151
+ if (process.env.JIVE_RUNNER_ID && process.env.JIVE_TEAM_ID) {
5152
+ config = {
5153
+ id: parseInt(process.env.JIVE_RUNNER_ID),
5154
+ name: process.env.JIVE_RUNNER_NAME || "docker-runner",
5155
+ type: "docker",
5156
+ teamId: process.env.JIVE_TEAM_ID,
5157
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
5158
+ };
5159
+ return config;
5160
+ }
5161
+ throw new Error("Failed to load runner config - no config file found and JIVE_RUNNER_ID/JIVE_TEAM_ID env vars not set");
5148
5162
  }
5149
5163
  async function saveRunnerConfig(config$2) {
5150
5164
  await fs.mkdir(path.dirname(runnerConfigPath), { recursive: true });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@jive-ai/cli",
4
- "version": "0.0.37",
4
+ "version": "0.0.38",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "dist",