symphony-box 1.0.0 → 1.0.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.
Files changed (4) hide show
  1. package/README.md +2 -2
  2. package/cli.js +0 -1
  3. package/init.js +15 -9
  4. package/package.json +6 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @upstash/symphony-box
1
+ # symphony-box
2
2
 
3
- CLI to set up [Symphony](https://github.com/odysseus0/symphony) (OpenAI Codex orchestrator) on an [Upstash Box](https://upstash.com/docs/box/overall/getstarted) for a GitHub repo connected to a Linear project.
3
+ CLI to set up [Symphony](https://github.com/openai/symphony) (OpenAI Codex orchestrator) on an [Upstash Box](https://upstash.com/docs/box/overall/getstarted) for a GitHub repo connected to a Linear project.
4
4
 
5
5
  ## What it does
6
6
 
package/cli.js CHANGED
@@ -86,7 +86,6 @@ async function main() {
86
86
  intro(chalk.cyan("Symphony Box Setup"));
87
87
 
88
88
  const upstashBoxApiKey = await promptText("Upstash Box API key", "UPSTASH_BOX_API_KEY", opts.upstashBoxApiKey);
89
-
90
89
  const openaiApiKey = await promptText("OpenAI API key", "OPENAI_API_KEY", opts.openaiApiKey, "sk-...");
91
90
  const linearApiKey = await promptText("Linear API key", "LINEAR_API_KEY", opts.linearApiKey, "lin_api_...");
92
91
  const githubToken = await promptText("GitHub token (requires read/write access for contents and pull requests)", "GITHUB_TOKEN", opts.githubToken, "ghp_...");
package/init.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Box } from "@upstash/box";
2
2
  import { buildWorkflow } from "./workflow.js";
3
3
 
4
- const SYMPHONY_URL = "https://github.com/odysseus0/symphony";
4
+ const SYMPHONY_URL = "https://github.com/openai/symphony.git";
5
5
  const MISE = "/home/boxuser/.local/bin/mise";
6
6
 
7
7
  async function linearQuery(linearApiKey, query, variables) {
@@ -27,7 +27,7 @@ const REQUIRED_STATES = [
27
27
  async function setupLinear(linearApiKey, projectName, onMissingStates) {
28
28
  const data = await linearQuery(
29
29
  linearApiKey,
30
- `{ projects { nodes { name slugId teams { nodes { id } } } } }`
30
+ `{ projects { nodes { name slugId teams { nodes { id } } } } }`,
31
31
  );
32
32
  const project = data.projects.nodes.find((p) => p.name === projectName);
33
33
  if (!project) throw new Error(`Linear project "${projectName}" not found`);
@@ -36,7 +36,7 @@ async function setupLinear(linearApiKey, projectName, onMissingStates) {
36
36
 
37
37
  const statesData = await linearQuery(
38
38
  linearApiKey,
39
- `{ workflowStates { nodes { name team { id } } } }`
39
+ `{ workflowStates { nodes { name team { id } } } }`,
40
40
  );
41
41
  const existing = statesData.workflowStates.nodes
42
42
  .filter((s) => s.team?.id === teamId)
@@ -60,7 +60,7 @@ async function setupLinear(linearApiKey, projectName, onMissingStates) {
60
60
  type: "started",
61
61
  color: state.color,
62
62
  },
63
- }
63
+ },
64
64
  );
65
65
  }
66
66
  }
@@ -78,13 +78,13 @@ export async function run_init(
78
78
  repoName,
79
79
  linearProjectName,
80
80
  },
81
- { onStep = () => {}, onMissingStates = async () => true } = {}
81
+ { onStep = () => {}, onMissingStates = async () => true } = {},
82
82
  ) {
83
83
  onStep("linear", "Checking Linear project and workflow states...");
84
84
  const { slugId } = await setupLinear(
85
85
  linearApiKey,
86
86
  linearProjectName,
87
- onMissingStates
87
+ onMissingStates,
88
88
  );
89
89
 
90
90
  onStep("workflow", `Building WORKFLOW.md (slug: ${slugId})...`);
@@ -100,7 +100,7 @@ export async function run_init(
100
100
 
101
101
  onStep("deps", `Box ${box.id} — installing system dependencies...`);
102
102
  await box.exec.command(
103
- "sudo apk add --no-cache git github-cli build-base perl bison ncurses-dev openssl-dev libssh-dev unixodbc-dev libxml2-dev"
103
+ "sudo apk add --no-cache git github-cli build-base perl bison ncurses-dev openssl-dev libssh-dev unixodbc-dev libxml2-dev",
104
104
  );
105
105
 
106
106
  onStep("codex", "Installing Codex...");
@@ -123,15 +123,21 @@ export async function run_init(
123
123
  onStep("build", "Cloning and building Symphony (~5 mins)...");
124
124
  await box.exec.command(`git clone ${SYMPHONY_URL}`);
125
125
  await box.exec.command(
126
- `cd symphony/elixir && ${MISE} trust && ${MISE} install`
126
+ `cd symphony/elixir && ${MISE} trust && ${MISE} install`,
127
127
  );
128
128
  await box.exec.command(`cd symphony/elixir && ${MISE} exec -- mix setup`);
129
129
  await box.exec.command(`cd symphony/elixir && ${MISE} exec -- mix build`);
130
130
 
131
131
  onStep("run", "Starting Symphony...");
132
132
  const stream = await box.exec.stream(
133
- `cd symphony/elixir && ${MISE} exec -- ./bin/symphony /workspace/home/${repoName}/WORKFLOW.md --i-understand-that-this-will-be-running-without-the-usual-guardrails`
133
+ `cd symphony/elixir && ${MISE} exec -- ./bin/symphony /workspace/home/${repoName}/WORKFLOW.md --i-understand-that-this-will-be-running-without-the-usual-guardrails`,
134
134
  );
135
135
 
136
+ // Ping the box to keep it alive
137
+ await box.schedule.exec({
138
+ cron: "0 */2 * * *",
139
+ command: ["sh", "-c", ":"],
140
+ });
141
+
136
142
  return { boxId: box.id, stream };
137
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "symphony-box",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "CLI to set up Symphony (OpenAI Codex orchestrator) on an Upstash Box for a GitHub repo",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,13 +20,17 @@
20
20
  "cli",
21
21
  "linear"
22
22
  ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/alitariksahin/symphony-box.git"
26
+ },
23
27
  "license": "MIT",
24
28
  "engines": {
25
29
  "node": ">=18"
26
30
  },
27
31
  "dependencies": {
28
32
  "@clack/prompts": "^0.11.0",
29
- "@upstash/box": "latest",
33
+ "@upstash/box": "^0.1.30",
30
34
  "chalk": "^5.4.1",
31
35
  "commander": "^14.0.0"
32
36
  }