@plainconceptsplatform/workflows 1.0.2 → 1.0.4

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/dist/index.js CHANGED
File without changes
@@ -2,6 +2,28 @@
2
2
 
3
3
  const OPENCODE_VERSION = '2.0.22'
4
4
  const OPENCODE_PACKAGE = '@opencode/cli'
5
+
6
+ // The install the compiled locks carry, shared so both rewrite sites emit exactly
7
+ // the same command.
8
+ //
9
+ // `--allow-scripts` is the part that matters. npm now blocks a dependency's
10
+ // install scripts unless the package is explicitly allowed, and @opencode/cli
11
+ // downloads its platform binary from its own postinstall. Without the flag the
12
+ // install "succeeds" (exit 0, `added N packages`) while the postinstall is
13
+ // skipped with a warning, leaving a stub bin and the previous version in place,
14
+ // so the job runs OpenCode 1 against OpenCode 2 config and the gateway rejects
15
+ // every model. `NPM_CONFIG_ALLOW_SCRIPTS` is the spelling npm accepts for a
16
+ // global install; the CLI form is refused for project-scoped installs.
17
+ //
18
+ // The trailing check turns a silent bad install into a loud failure: if the
19
+ // version still is not there after installing, the step exits non-zero rather
20
+ // than letting the agent run on the wrong binary.
21
+ const OPENCODE_INSTALL_GUARD =
22
+ "opencode --version 2>/dev/null | grep -qF '" + OPENCODE_VERSION + "' || " +
23
+ "flock /tmp/opencode-install.lock sh -c " +
24
+ "'NPM_CONFIG_ALLOW_SCRIPTS=" + OPENCODE_PACKAGE + " npm install -g " + OPENCODE_PACKAGE + "@" + OPENCODE_VERSION + "' ; " +
25
+ "opencode --version 2>/dev/null | grep -qF '" + OPENCODE_VERSION + "' || " +
26
+ "{ echo \"::error::opencode " + OPENCODE_VERSION + " is not installed after the install step\"; exit 1; }"
5
27
  import { spawnSync } from "node:child_process";
6
28
  import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
7
29
  import { join } from "node:path";
@@ -122,7 +144,10 @@ for (const file of readdirSync(workflowDirectory)) {
122
144
  // explicitly, so the remote registry is not needed here.
123
145
  // - --print-logs + a non-silent level: stripping --print-logs and forcing
124
146
  // ERROR hid every engine log, so a stalled bootstrap looked like silence.
125
- .replace(/opencode run(?: --print-logs)? --log-level (?:DEBUG|ERROR|INFO)/g, "OPENCODE_DISABLE_MODELS_FETCH=1 opencode run --print-logs --log-level INFO")
147
+ // The level must be lower case: OpenCode 2 rejects `INFO` with
148
+ // "Invalid value for flag --log-level", aborting before the agent runs.
149
+ // The old upper-case spelling was valid in v1 and is not in v2.
150
+ .replace(/opencode run(?: --print-logs)? --log-level (?:DEBUG|ERROR|INFO|debug|error|info)/g, "OPENCODE_DISABLE_MODELS_FETCH=1 opencode run --print-logs --log-level info")
126
151
  .replace(/GH_AW_INFO_MODEL: "[^"]*"/g, 'GH_AW_INFO_MODEL: "per-agent"')
127
152
  .replace(/OPENCODE_MODEL: [^\n]+/g, "OPENCODE_MODEL: ''")
128
153
  .replace(/GH_AW_INFO_MODEL_COSTS: '[^']*'/g, 'GH_AW_INFO_MODEL_COSTS: \'{"providers":{}}\'')
@@ -291,15 +316,10 @@ for (const file of readdirSync(workflowDirectory)) {
291
316
  .replace(
292
317
  /opencode --version[^\n]*grep -qF '[0-9][0-9.]*' \|\|[^\n]*?npm install --ignore-scripts -g opencode-ai@[0-9][0-9.]*[^\n]*/g,
293
318
  () =>
294
- "opencode --version 2>/dev/null | grep -qF '" + OPENCODE_VERSION + "' || " +
295
- "flock /tmp/opencode-install.lock npm install -g " + OPENCODE_PACKAGE + "@" + OPENCODE_VERSION +
296
- " # " + OPENCODE_PACKAGE + "@" + OPENCODE_VERSION)
319
+ OPENCODE_INSTALL_GUARD)
297
320
  .replace(
298
321
  /npm install --ignore-scripts -g opencode-ai@([0-9][0-9.]*)/g,
299
- () =>
300
- "opencode --version 2>/dev/null | grep -qF '" + OPENCODE_VERSION + "' || " +
301
- "flock /tmp/opencode-install.lock npm install -g " + OPENCODE_PACKAGE + "@" + OPENCODE_VERSION +
302
- " # " + OPENCODE_PACKAGE + "@" + OPENCODE_VERSION)
322
+ () => OPENCODE_INSTALL_GUARD)
303
323
  .replace(/opencode-ai@[0-9][0-9.]*/g, OPENCODE_PACKAGE + '@' + OPENCODE_VERSION)
304
324
  .replace(/opencode-ai\b/g, OPENCODE_PACKAGE)
305
325
  // One warm server per runner, on its own port, with its own data directory. Keyed on the
package/package.json CHANGED
@@ -1,45 +1,46 @@
1
- {
2
- "name": "@plainconceptsplatform/workflows",
3
- "version": "1.0.2",
4
- "description": "Install and update Platform GitHub agentic workflows.",
5
- "keywords": [
6
- "github-actions",
7
- "agentic-workflows",
8
- "plain-concepts"
9
- ],
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/PlainConceptsPlatform/agentic-workflows.git"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/PlainConceptsPlatform/agentic-workflows/issues"
16
- },
17
- "homepage": "https://github.com/PlainConceptsPlatform/agentic-workflows#readme",
18
- "license": "UNLICENSED",
19
- "type": "module",
20
- "bin": {
21
- "workflows": "./dist/index.js"
22
- },
23
- "files": [
24
- "dist",
25
- "loops",
26
- "README.md"
27
- ],
28
- "engines": {
29
- "node": ">=20.19"
30
- },
31
- "dependencies": {
32
- "yaml": "^2.9.0"
33
- },
34
- "devDependencies": {
35
- "@types/node": "^22.0.0",
36
- "typescript": "^5.8.0",
37
- "vitest": "^3.0.0"
38
- },
39
- "scripts": {
40
- "build": "tsc --project tsconfig.build.json && node ./scripts/copy-loops.mjs",
41
- "test": "vitest run",
42
- "typecheck": "tsc --noEmit --project tsconfig.json",
43
- "release": "pnpm build && pnpm test && npm publish --access public"
44
- }
45
- }
1
+ {
2
+ "name": "@plainconceptsplatform/workflows",
3
+ "version": "1.0.4",
4
+ "description": "Install and update Platform GitHub agentic workflows.",
5
+ "keywords": [
6
+ "github-actions",
7
+ "agentic-workflows",
8
+ "plain-concepts"
9
+ ],
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/PlainConceptsPlatform/agentic-workflows.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/PlainConceptsPlatform/agentic-workflows/issues"
16
+ },
17
+ "homepage": "https://github.com/PlainConceptsPlatform/agentic-workflows#readme",
18
+ "license": "UNLICENSED",
19
+ "type": "module",
20
+ "bin": {
21
+ "workflows": "./dist/index.js"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "loops",
26
+ "README.md"
27
+ ],
28
+ "scripts": {
29
+ "build": "tsc --project tsconfig.build.json && node ./scripts/copy-loops.mjs",
30
+ "test": "vitest run",
31
+ "typecheck": "tsc --noEmit --project tsconfig.json",
32
+ "release": "pnpm build && pnpm test && npm publish --access public",
33
+ "prepack": "node ./scripts/copy-loops.mjs"
34
+ },
35
+ "engines": {
36
+ "node": ">=20.19"
37
+ },
38
+ "dependencies": {
39
+ "yaml": "^2.9.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^22.0.0",
43
+ "typescript": "^5.8.0",
44
+ "vitest": "^3.0.0"
45
+ }
46
+ }