gsd-for-omp 1.1.4 → 1.1.6

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/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `gsd-for-omp` are recorded here in [Keep a Changelog](htt
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.1.6] - 2026-11-19
8
+
9
+ ### Fixed
10
+
11
+ - The GSD language picker no longer comes back for a project that was already set up. The language chosen in OMP (and an explicit interaction style) is remembered per project in `<runtime-root>/.gsd-for-omp-project-preferences.json`. When `.planning/config.json` loses `response_language`, for example because a `git checkout`, stash, pull or branch switch dropped the uncommitted edit, the next session writes it back and shows `Restored GSD language: <language>` instead of asking again.
12
+
13
+ ## [1.1.5] - 2026-11-05
14
+
15
+ ### Changed
16
+
17
+ - Updated the bundled `@opengsd/gsd-core` dependency to `^1.20.0`. Run `gsd-for-omp install` after updating to refresh the projected agents and skills.
18
+
7
19
  ## [1.1.4] - 2026-10-29
8
20
 
9
21
  ### Changed
@@ -118,7 +130,9 @@ Related: [PR #53](https://github.com/tchivs/gsd-omp/pull/53), [release PR #54](h
118
130
 
119
131
  Related: [PR #51](https://github.com/tchivs/gsd-omp/pull/51), [release PR #52](https://github.com/tchivs/gsd-omp/pull/52).
120
132
 
121
- [Unreleased]: https://github.com/GManzato/gsd-for-omp/compare/v1.1.4...HEAD
133
+ [Unreleased]: https://github.com/GManzato/gsd-for-omp/compare/v1.1.6...HEAD
134
+ [1.1.6]: https://github.com/GManzato/gsd-for-omp/compare/v1.1.5...v1.1.6
135
+ [1.1.5]: https://github.com/GManzato/gsd-for-omp/compare/v1.1.4...v1.1.5
122
136
  [1.1.4]: https://github.com/GManzato/gsd-for-omp/compare/v1.1.3...v1.1.4
123
137
  [1.1.3]: https://github.com/GManzato/gsd-for-omp/compare/v1.1.2...v1.1.3
124
138
  [1.1.2]: https://github.com/GManzato/gsd-for-omp/compare/v1.1.1...v1.1.2
@@ -134,7 +134,7 @@ The extension also invokes selected GSD hook scripts on `tool_call` (`Write`/`Ed
134
134
 
135
135
  Lifecycle event handling is project-scoped (the extension first checks whether the current directory has a recognizable planning workspace):
136
136
 
137
- - `session_start` schedules one-time onboarding when `response_language` is absent, refreshes status, optionally opens the `--gsd-status` overlay, and shows a workflow-guard reminder.
137
+ - `session_start` restores a remembered `response_language` when the project config has lost it, otherwise schedules one-time onboarding when `response_language` is absent; it then refreshes status, optionally opens the `--gsd-status` overlay, and shows a workflow-guard reminder.
138
138
  - `session_switch`, `session_branch`, `session_tree`, and `session_compact` refresh status and clear context-local Goal Mode state where appropriate.
139
139
  - `auto_compaction_start/end`, `auto_retry_start/end`, and `session_stop` expose transient native runtime signals in status.
140
140
  - `message_end` extracts pending next-action/checkpoint records from assistant text and persists them in the planning workspace.
@@ -156,7 +156,7 @@ When a goal is active (`enabled === true` and goal status `active`), the extensi
156
156
 
157
157
  `src/locale.cjs` handles messages emitted by the shell CLI and EoS bootstrap. It resolves the first non-empty value in this order: `GSD_FOR_OMP_LOCALE`, `LC_ALL`, `LC_MESSAGES`, `LANG`. Values whose lowercased form starts with `zh` select `zh-CN`; all other values select `en`. Missing dictionary keys fall back to English, and unknown placeholders remain unchanged.
158
158
 
159
- The in-session extension uses the project planning config's `response_language` instead. On the first interactive session for a project without that field, onboarding offers Simplified Chinese or English and writes the selected value to `.planning/config.json`; the optional interaction-style selection can also write `workflow.text_mode`. This separation prevents a shell locale from unexpectedly changing an already configured project session.
159
+ The in-session extension uses the project planning config's `response_language` instead. On the first interactive session for a project without that field, onboarding offers Simplified Chinese or English and writes the selected value to `.planning/config.json`; the optional interaction-style selection can also write `workflow.text_mode`. The extension also keeps a per-project copy of both values in `<runtime-root>/.gsd-for-omp-project-preferences.json` and writes them back when the config loses `response_language`, so a reset of an uncommitted config edit does not reopen the picker. This separation prevents a shell locale from unexpectedly changing an already configured project session.
160
160
 
161
161
  ## Tests and host-smoke boundary
162
162
 
@@ -27,6 +27,7 @@ The path is resolved to an absolute path. A normal installed layout is:
27
27
  ```text
28
28
  <runtime-root>/
29
29
  ├── .gsd-for-omp-manifest.json
30
+ ├── .gsd-for-omp-project-preferences.json (written by the extension, not the installer)
30
31
  ├── extensions/gsd-for-omp.ts
31
32
  ├── agents/gsd-*.md
32
33
  └── skills/gsd-*/SKILL.md
@@ -97,6 +98,8 @@ A minimal project-language example is:
97
98
 
98
99
  To select Simplified Chinese explicitly, use `"response_language": "Simplified Chinese"`. The first interactive `session_start` for a GSD project with no `response_language` offers `Simplified Chinese` or `English`; it can also ask for interaction style if `workflow.text_mode` is not already explicit. Projects without an interactive UI do not receive that picker.
99
100
 
101
+ The extension remembers each project's `response_language` and explicit boolean `workflow.text_mode` in `<runtime-root>/.gsd-for-omp-project-preferences.json`, keyed by the absolute config path, and refreshes that record whenever a session starts with a language set. If `.planning/config.json` later loses `response_language` (for example a `git checkout`, stash, pull or branch switch discards the uncommitted edit), the next session writes the remembered values back without asking again and shows `Restored GSD language: <language>`. A `workflow.text_mode` already present in the config is kept. Commit `.planning/config.json` to share the setting with other clones; delete the project's entry from the preferences file to be asked again.
102
+
100
103
  ## Phase execution and task isolation
101
104
 
102
105
  `/gsd-execute-phase` dispatches every executor as an OMP native `task` with `isolated: true`. OMP offers that option only while `task.isolation.enabled` is `true` and plan mode is off, so the command checks the task tool's live schema before it starts a run:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-for-omp",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Oh My Pi host plugin for the GSD Embeddable Orchestration System — extension bindings, slash-command surface, Host-Integration SDK adapter, and optional Goal Mode status integration for AI coding agents",
5
5
  "license": "MIT",
6
6
  "author": "Gilles Manzato",
@@ -27,7 +27,7 @@
27
27
  "prepack": "npm run lint && npm test"
28
28
  },
29
29
  "dependencies": {
30
- "@opengsd/gsd-core": "^1.19.0"
30
+ "@opengsd/gsd-core": "^1.20.0"
31
31
  },
32
32
  "engines": {
33
33
  "node": ">=24.0.0",
@@ -2,13 +2,23 @@
2
2
 
3
3
  /**
4
4
  * First-run language and interaction-style prompt persisted to .planning/config.json.
5
+ *
6
+ * The chosen `response_language` (and an explicit `workflow.text_mode`) is also
7
+ * remembered per project config path in the runtime root, outside the project
8
+ * checkout. When something rewrites or resets `.planning/config.json` (a git
9
+ * checkout, stash, pull or branch switch dropping an uncommitted edit), the next
10
+ * session restores the remembered values instead of asking again.
5
11
  */
6
12
 
13
+ const fs = require('node:fs');
7
14
  const path = require('node:path');
15
+ const { usesChinese } = require('./localize.cjs');
8
16
  const { nativeSelect } = require('./native-ui.cjs');
9
17
  const { isGsdProject, planningFilePath, readProjectConfig } = require('./planning.cjs');
10
18
  const { writeJsonAtomically } = require('./util.cjs');
11
19
 
20
+ const PROJECT_PREFERENCES_FILE = '.gsd-for-omp-project-preferences.json';
21
+
12
22
  function hasExplicitTextMode(config) {
13
23
  return Object.prototype.hasOwnProperty.call(config?.workflow || {}, 'text_mode');
14
24
  }
@@ -19,6 +29,57 @@ function persistOnboarding(cwd, config, language, textMode) {
19
29
  return writeJsonAtomically(planningFilePath(cwd, 'config'), nextConfig);
20
30
  }
21
31
 
32
+ function rememberedProjects(preferencesPath) {
33
+ try {
34
+ const projects = JSON.parse(fs.readFileSync(preferencesPath, 'utf8'))?.projects;
35
+ return projects && typeof projects === 'object' && !Array.isArray(projects) ? projects : {};
36
+ } catch {
37
+ return {};
38
+ }
39
+ }
40
+
41
+ function projectPreferences(config) {
42
+ const language = config.response_language;
43
+ if (typeof language !== 'string' || !language.trim()) return null;
44
+ const textMode = config.workflow?.text_mode;
45
+ return typeof textMode === 'boolean' ? { response_language: language, text_mode: textMode } : { response_language: language };
46
+ }
47
+
48
+ function rememberedPreferences(projects, configPath) {
49
+ if (!Object.hasOwn(projects, configPath)) return null;
50
+ const entry = projects[configPath];
51
+ return entry && typeof entry === 'object' ? projectPreferences({ response_language: entry.response_language, workflow: { text_mode: entry.text_mode } }) : null;
52
+ }
53
+
54
+ /**
55
+ * Remember the project's configured language, or restore the remembered one when
56
+ * the config has lost it. Returns true when the project config was rewritten.
57
+ */
58
+ function syncProjectPreferences(ctx, preferencesPath) {
59
+ const config = readProjectConfig(ctx.cwd);
60
+ if (!config || typeof config !== 'object' || Array.isArray(config)) return false;
61
+ const configPath = path.resolve(planningFilePath(ctx.cwd, 'config'));
62
+ const projects = rememberedProjects(preferencesPath);
63
+ const current = projectPreferences(config);
64
+ if (current) {
65
+ const remembered = rememberedPreferences(projects, configPath);
66
+ if (remembered?.response_language !== current.response_language || remembered?.text_mode !== current.text_mode) {
67
+ writeJsonAtomically(preferencesPath, { projects: { ...projects, [configPath]: current } });
68
+ }
69
+ return false;
70
+ }
71
+ const remembered = rememberedPreferences(projects, configPath);
72
+ if (!remembered) return false;
73
+ const textMode = hasExplicitTextMode(config) ? undefined : remembered.text_mode;
74
+ if (!persistOnboarding(ctx.cwd, config, remembered.response_language, textMode)) return false;
75
+ if (ctx.hasUI) {
76
+ ctx.ui?.notify?.(usesChinese(ctx.cwd)
77
+ ? `已恢复 GSD 界面语言:${remembered.response_language}`
78
+ : `Restored GSD language: ${remembered.response_language}`, 'info');
79
+ }
80
+ return true;
81
+ }
82
+
22
83
  async function promptForOnboarding(ctx) {
23
84
  const config = readProjectConfig(ctx.cwd);
24
85
  if (!ctx.hasUI || !isGsdProject(ctx.cwd) || !config || config.response_language || (typeof ctx.ui?.select !== 'function' && typeof ctx.ui?.askDialog !== 'function')) return false;
@@ -58,17 +119,24 @@ async function promptForOnboarding(ctx) {
58
119
  }
59
120
 
60
121
  /**
61
- * Schedules the onboarding prompt once per project (`state.onboardingPromptCwds`).
122
+ * Restores or remembers the project language, then schedules the onboarding
123
+ * prompt once per project (`state.onboardingPromptCwds`) when none is known.
62
124
  */
63
- function createOnboarding({ state, updateStatus }) {
125
+ function createOnboarding({ state, updateStatus, runtimeRoot }) {
64
126
  const { onboardingPromptCwds } = state;
127
+ const preferencesPath = path.join(runtimeRoot, PROJECT_PREFERENCES_FILE);
65
128
 
66
129
  function scheduleOnboardingPrompt(ctx) {
67
130
  const projectPath = path.resolve(ctx.cwd);
68
131
  if (onboardingPromptCwds.has(projectPath)) return;
132
+ if (syncProjectPreferences(ctx, preferencesPath)) return;
69
133
  onboardingPromptCwds.add(projectPath);
70
134
  void promptForOnboarding(ctx)
71
- .then((changed) => { if (changed) updateStatus(ctx); })
135
+ .then((changed) => {
136
+ if (!changed) return;
137
+ syncProjectPreferences(ctx, preferencesPath);
138
+ updateStatus(ctx);
139
+ })
72
140
  .catch(() => {})
73
141
  .finally(() => onboardingPromptCwds.delete(projectPath));
74
142
  }
package/src/extension.cjs CHANGED
@@ -61,7 +61,7 @@ module.exports = function gsdPiExtension(pi, options = {}) {
61
61
  const status = createStatusSurface({ state, ...goalMode, ...taskTracker, updateNotice: updateCheck.updateNotice });
62
62
  const nativeUi = createNativeUi({ pi, ...status });
63
63
  const sessionControls = createSessionControls({ pi, ...goalMode, ...taskTracker, ...status });
64
- const onboarding = createOnboarding({ state, ...status });
64
+ const onboarding = createOnboarding({ state, runtimeRoot, ...status });
65
65
  const launchers = createNativeLaunchers({ pi, options, agentsDir, cliPath, state });
66
66
  const continuation = createContinuation({ pi, ...goalMode, ...taskTracker, ...status, ...launchers });
67
67
  const projectedSkills = createProjectedSkills({ pi, runtimeRoot, ...launchers });