dsh-continual-evolve 0.10.3 → 0.10.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.
@@ -39,6 +39,14 @@ export declare function detectLanguageFromText(text: string): RecordLanguage | u
39
39
  * service. Fail-open by contract: a missing service, a throwing read, an
40
40
  * async-shaped reply, or an unknown value all yield `undefined`.
41
41
  *
42
+ * The service is resolved through `ctx.get("settings")` (the global registry),
43
+ * which sees services provided by sibling plugin entries. A direct
44
+ * `ctx.settings` walks only the caller's fiber ancestor chain and throws
45
+ * "cannot get property \"settings\" without inject" — the same failure mode
46
+ * documented in `goal.ts` — and a throw here would abort the whole snapshot
47
+ * gate, so the property access itself is guarded. Plain-object contexts
48
+ * (tests, non-Cordis hosts) fall back to the direct property.
49
+ *
42
50
  * @param ctx Cordis context that may carry the host settings service.
43
51
  * @returns The stored preference (`zh`/`en`, subtag-tolerant) or `undefined`.
44
52
  */
@@ -44,13 +44,30 @@ export function detectLanguageFromText(text) {
44
44
  * service. Fail-open by contract: a missing service, a throwing read, an
45
45
  * async-shaped reply, or an unknown value all yield `undefined`.
46
46
  *
47
+ * The service is resolved through `ctx.get("settings")` (the global registry),
48
+ * which sees services provided by sibling plugin entries. A direct
49
+ * `ctx.settings` walks only the caller's fiber ancestor chain and throws
50
+ * "cannot get property \"settings\" without inject" — the same failure mode
51
+ * documented in `goal.ts` — and a throw here would abort the whole snapshot
52
+ * gate, so the property access itself is guarded. Plain-object contexts
53
+ * (tests, non-Cordis hosts) fall back to the direct property.
54
+ *
47
55
  * @param ctx Cordis context that may carry the host settings service.
48
56
  * @returns The stored preference (`zh`/`en`, subtag-tolerant) or `undefined`.
49
57
  */
50
58
  export function durableLocalePreference(ctx) {
51
59
  if (typeof ctx !== "object" || ctx === null)
52
60
  return undefined;
53
- const settings = ctx.settings;
61
+ let settings;
62
+ try {
63
+ const get = ctx.get;
64
+ settings = typeof get === "function" ? get.call(ctx, "settings") : undefined;
65
+ if (settings === undefined)
66
+ settings = ctx.settings;
67
+ }
68
+ catch {
69
+ return undefined;
70
+ }
54
71
  if (typeof settings !== "object" || settings === null)
55
72
  return undefined;
56
73
  const describe = settings.describe;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-continual-evolve",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "Continual self-evolution plugin for DeepSeek Harness: versioned, auditable, rollback-safe harness state (prompt notes, memories, skills, subagent specs) refined from session trajectories.",
5
5
  "license": "MIT",
6
6
  "repository": {