@awak-app/simy-cli 0.7.37 → 0.7.38

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 (29) hide show
  1. package/package.json +1 -1
  2. package/src/auto-update.js +25 -13
  3. package/src/cli-contract.js +1 -1
  4. package/src/cli-observability.js +2 -2
  5. package/src/codex-plugins/simy/hooks/delivery-loop.mjs +240 -24
  6. package/src/codex-plugins/simy/hooks/purpose-workspace.mjs +4 -1
  7. package/src/codex-plugins/simy/hooks/registered-requirement-checker.mjs +201 -0
  8. package/src/codex-plugins/simy/hooks/requirement-acceptance.mjs +69 -0
  9. package/src/delivery-hooks/supervisor-watchdog.js +3 -2
  10. package/src/desktop-host.js +48 -18
  11. package/src/session-supervision/acceptance-reads.js +11 -2
  12. package/src/session-supervision/analysis-manager.js +9 -2
  13. package/src/session-supervision/catalog-refresh.js +16 -0
  14. package/src/session-supervision/claude-native-agent-contract.js +62 -0
  15. package/src/session-supervision/claude-outcome-review.js +7 -6
  16. package/src/session-supervision/claude-sessions.js +137 -76
  17. package/src/session-supervision/codex-app-server.js +3 -3
  18. package/src/session-supervision/codex-children.js +2 -2
  19. package/src/session-supervision/conversation-context.js +58 -26
  20. package/src/session-supervision/discovery-window.js +8 -2
  21. package/src/session-supervision/index.js +25 -12
  22. package/src/session-supervision/purpose-verification.js +12 -3
  23. package/src/sqm/advisory-guidance.js +1 -0
  24. package/src/sqm/checkers.js +35 -1
  25. package/src/sqm/claude-plugin.js +7 -1
  26. package/src/sqm/hypothesis-knowledge.js +3 -3
  27. package/src/sqm/knowledge-recall.js +34 -12
  28. package/src/sqm/reasoned-assessment.js +22 -9
  29. package/src/update-detachment/runtime.js +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awak-app/simy-cli",
3
- "version": "0.7.37",
3
+ "version": "0.7.38",
4
4
  "description": "Local SIMY executor for non-coding Local Tasks and Agentic Loop runs.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -88,14 +88,7 @@ export class CliAutoUpdater extends EventEmitter {
88
88
  current_version: options.currentVersion,
89
89
  target_version: null,
90
90
  install_mode: options.installMode,
91
- automatic: Boolean(
92
- !options.disabled &&
93
- options.autoUpdatesEnabled !== false &&
94
- options.daemon &&
95
- (options.installMode === "global_npm" ||
96
- (options.installMode === MACOS_INSTALLER_MODE && options.installerMarker?.teamId)) &&
97
- options.requestedPort === 0
98
- ),
91
+ automatic: options.autoUpdatesEnabled !== false && this.#automaticUpdateUnavailableReason() === null,
99
92
  checked_at: null,
100
93
  message: options.disabled
101
94
  ? "Automatic update checks are disabled."
@@ -105,11 +98,25 @@ export class CliAutoUpdater extends EventEmitter {
105
98
  };
106
99
  }
107
100
 
101
+ #automaticUpdateUnavailableReason() {
102
+ if (this.#options.disabled) return 'disabled_by_environment';
103
+ if (!this.#options.daemon) return 'foreground_session';
104
+ if (this.#options.requestedPort !== 0) return 'fixed_port';
105
+ if (this.#options.installMode === MACOS_INSTALLER_MODE) return this.#options.installerMarker?.teamId ? null : 'unsigned_installation';
106
+ return this.#options.installMode === 'global_npm' ? null : 'unsupported_installation';
107
+ }
108
+
108
109
  snapshot() {
109
- const supported = !this.#options.disabled && this.#options.daemon && this.#options.requestedPort === 0 &&
110
- (this.#options.installMode === 'global_npm' || this.#options.installMode === MACOS_INSTALLER_MODE && Boolean(this.#options.installerMarker?.teamId));
110
+ const unavailable = this.#automaticUpdateUnavailableReason();
111
+ const supported = unavailable === null;
111
112
  return structuredClone({ ...this.#snapshot, auto_update_supported: Boolean(supported),
112
- auto_update_enabled: this.#snapshot.automatic, auto_update_busy: Boolean(this.#applying || this.#confirmedUpdate), requires_task_stop: !this.#isIdle() });
113
+ auto_update_enabled: this.#snapshot.automatic,
114
+ auto_update_unavailable_reason: unavailable,
115
+ // Explicit installation is independent of the saved background preference.
116
+ can_install_update: Boolean(supported && this.#options.installMode === MACOS_INSTALLER_MODE &&
117
+ this.#options.lastRelease?.artifact?.updater && this.#snapshot.target_version &&
118
+ classifyVersionChange(this.#options.currentVersion, this.#snapshot.target_version) !== 'major'),
119
+ auto_update_busy: Boolean(this.#applying || this.#confirmedUpdate), requires_task_stop: !this.#isIdle() });
113
120
  }
114
121
 
115
122
  setAutomaticUpdates(enabled) {
@@ -137,7 +144,7 @@ export class CliAutoUpdater extends EventEmitter {
137
144
  await this.#checking;
138
145
  if (!this.#snapshot.target_version) throw new Error('The update is no longer available.');
139
146
  if (!this.#isIdle()) throw new Error('Task shutdown did not finish. Restart SIMY and retry the update.');
140
- if (!this.#snapshot.automatic || classifyVersionChange(this.#options.currentVersion, this.#snapshot.target_version) === 'major') {
147
+ if ((!this.#snapshot.automatic && !this.snapshot().can_install_update) || classifyVersionChange(this.#options.currentVersion, this.#snapshot.target_version) === 'major') {
141
148
  this.#setState('update_available', { message: 'Tasks stopped. Opening the update installer…' });
142
149
  await this.performAction();
143
150
  return this.snapshot();
@@ -155,6 +162,8 @@ export class CliAutoUpdater extends EventEmitter {
155
162
  }
156
163
 
157
164
  async performAction() {
165
+ const snapshot = this.snapshot();
166
+ if (snapshot.can_install_update && ['update_available', 'waiting_for_idle'].includes(snapshot.state)) return this.maybeApply({ manual: true });
158
167
  const action = this.#snapshot.action;
159
168
  if (action?.id === "download_macos_installer" && action.url) {
160
169
  const result = await this.#options.openUrl(action.url);
@@ -309,7 +318,10 @@ export class CliAutoUpdater extends EventEmitter {
309
318
  }
310
319
  }
311
320
 
312
- async maybeApply({ detach = false } = {}) {
321
+ async maybeApply({ detach = false, manual = false } = {}) {
322
+ if (manual && !this.#stopped && this.#snapshot.state === 'update_available' && this.snapshot().can_install_update) {
323
+ this.#setState('waiting_for_idle', { message: 'Preparing the requested update…', error: null });
324
+ }
313
325
  if (this.#confirmedUpdate && !this.#confirmedReady) return this.snapshot();
314
326
  if (this.#stopped || this.#snapshot.state !== "waiting_for_idle") {
315
327
  return this.snapshot();
@@ -14,7 +14,7 @@ import {
14
14
  } from "./durable-local-task-steps-contract.js";
15
15
  import { buildExecutionCapabilityContract } from "./execution-capability-contract.js";
16
16
 
17
- export const CLI_VERSION = "0.7.37";
17
+ export const CLI_VERSION = "0.7.38";
18
18
  export const CLI_API_CONTRACT_VERSION = 10;
19
19
 
20
20
  export function narrativeImageCapabilityMetadata() {
@@ -6,8 +6,8 @@ import { dirname, join } from 'node:path';
6
6
  import { execFile } from 'node:child_process';
7
7
  import { promisify } from 'node:util';
8
8
  import { webApiHeaders, webApiUrl } from './web-api.js';
9
- // Keep this leaf module package-safe: hooks load it before the full CLI contract.
10
- const CLI_VERSION = '0.7.37';
9
+ // The standalone Claude plugin generator freezes this import to the same version.
10
+ import { CLI_VERSION } from './cli-contract.js';
11
11
 
12
12
  const STORE = 'cli-observability-state.json';
13
13
  const LEGACY_CONFIG = 'cli-observability.json';