@foundocs/foundocs-setup 0.3.19 → 0.3.20

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/README.md CHANGED
@@ -230,13 +230,17 @@ preserve the pinned MCP runtime. To opt an installer-owned portable runtime into
230
230
  this release, run the new package's explicit upgrade, then refresh skills:
231
231
 
232
232
  ```sh
233
- npx --yes @foundocs/foundocs-setup@0.3.19 upgrade-runtime --root /absolute/project
234
- npx --yes @foundocs/foundocs-setup@0.3.19 update-skills --root /absolute/project
233
+ npx --yes @foundocs/foundocs-setup@0.3.20 upgrade-runtime --root /absolute/project
234
+ npx --yes @foundocs/foundocs-setup@0.3.20 update-skills --root /absolute/project
235
235
  ```
236
236
 
237
237
  Legacy transports must first use the existing `migrate` flow. The upgrade checks
238
238
  the recorded transport, preserves foreign settings and credentials, journals its
239
- change, supports interrupted retry and the existing conflict-safe `rollback`.
239
+ change and supports interrupted retry. Version 0.3.20 recognizes the environment
240
+ list written by pre-episode portable runtimes, including 0.3.18; newer runtimes
241
+ still require the episode opt-out environment variable. The existing
242
+ conflict-safe `rollback` restores the original installation journal baseline,
243
+ which can precede initial setup; it is not a runtime-only undo command.
240
244
  Reconnect MCP and review the exact new hook hashes afterward. Skill updates do
241
245
  not silently activate or upgrade the runtime. `doctor` reports runtime support
242
246
  and live/stale checkpoint locks separately from host verification. If a crashed
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@foundocs/foundocs-setup",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "description": "Repeatable project setup and agent skills for the Foundocs remote MCP server",
5
5
  "foundocsRelease": {
6
- "summary": "Capture important work episodes through bounded Codex and Claude Code checkpoints, with private exact retries and focused recall."
6
+ "summary": "Recognize existing portable runtimes during episode upgrades while preserving runtime pins and conflict-safe rollback."
7
7
  },
8
8
  "type": "module",
9
9
  "bin": {
@@ -34,7 +34,8 @@
34
34
  "smol-toml": "1.9.1"
35
35
  },
36
36
  "devDependencies": {
37
- "esbuild": "0.28.2"
37
+ "esbuild": "0.28.2",
38
+ "foundocs-setup-previous": "npm:@foundocs/foundocs-setup@0.3.18"
38
39
  },
39
40
  "repository": {
40
41
  "type": "git",
package/src/setup.mjs CHANGED
@@ -214,7 +214,10 @@ function sameConfig(a, b) {
214
214
  return JSON.stringify(canonical(a)) === JSON.stringify(canonical(b));
215
215
  }
216
216
 
217
- export const RUNTIME_ENV = ['FOUNDOCS_SETUP_HOME', 'FOUNDOCS_EPISODES', 'FOUNDOCS_API_KEY', 'FOUNDOCS_PROJECT_ID', 'FOUNDOCS_WORKSPACE_ID', 'STEERDOCS_SETUP_HOME', 'STEERDOCS_API_KEY', 'STEERDOCS_PROJECT_ID', 'STEERDOCS_WORKSPACE_ID'];
217
+ // Published portable runtimes before 0.3.19 did not forward the episode opt-out.
218
+ // Keep historical requirements fixed; new environment fields need a version boundary.
219
+ const PRE_EPISODE_RUNTIME_ENV = ['FOUNDOCS_SETUP_HOME', 'FOUNDOCS_API_KEY', 'FOUNDOCS_PROJECT_ID', 'FOUNDOCS_WORKSPACE_ID', 'STEERDOCS_SETUP_HOME', 'STEERDOCS_API_KEY', 'STEERDOCS_PROJECT_ID', 'STEERDOCS_WORKSPACE_ID'];
220
+ export const RUNTIME_ENV = [PRE_EPISODE_RUNTIME_ENV[0], 'FOUNDOCS_EPISODES', ...PRE_EPISODE_RUNTIME_ENV.slice(1)];
218
221
 
219
222
  export function portableTransport(projectId, version = PACKAGE_VERSION, client = 'codex') {
220
223
  if (client === 'claude') return { type: 'stdio', command: 'npx', args: ['--yes', `@foundocs/foundocs-setup@${version}`, 'mcp', '--project-id', projectId] };
@@ -226,11 +229,12 @@ function transportOf(server) { return server && { command: server.command, args:
226
229
  export function portableVersion(server, projectId, client = 'codex') {
227
230
  if (!plainObject(server) || server.command !== 'npx' || !Array.isArray(server.args) || server.args.length !== 5) return null;
228
231
  if (server.cwd !== undefined || server.env !== undefined || server.url !== undefined || server.headersHelper !== undefined) return null;
229
- if (client === 'claude' ? server.type !== 'stdio' : (!Array.isArray(server.env_vars) || !RUNTIME_ENV.every(name => server.env_vars.includes(name)))) return null;
230
232
  const version = /^@foundocs\/foundocs-setup@((?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*))$/.exec(server.args[1])?.[1];
231
233
  if (!version || !sameConfig(transportOf(server), transportOf(portableTransport(projectId, version, client)))) return null;
232
234
  const [major, minor, patch] = version.split('.').map(Number);
233
235
  if (major === 0 && (minor < 3 || (minor === 3 && patch < (client === 'claude' ? 5 : 4)))) return null;
236
+ const requiredEnv = newer('0.3.19', version) ? PRE_EPISODE_RUNTIME_ENV : RUNTIME_ENV;
237
+ if (client === 'claude' ? server.type !== 'stdio' : (!Array.isArray(server.env_vars) || !requiredEnv.every(name => server.env_vars.includes(name)))) return null;
234
238
  return version;
235
239
  }
236
240