@defend-tech/opencode-optima 0.1.21 → 0.1.22

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
@@ -9382,11 +9382,12 @@ async function cleanupManagedClickUpWebhook(entry = {}, { timeoutMs = CLICKUP_WE
9382
9382
  clickUpWebhookLifecycleLog(entry.worktree, { type: "cleanup_started", reason, key: entry.key, webhookId: entry.state?.webhookId });
9383
9383
  const closeResult = await closeClickUpWebhookServer(entry.listener?.server);
9384
9384
  if (entry.listenerRegistry && entry.listener?.key) entry.listenerRegistry.delete(entry.listener.key);
9385
- const deleteResult = await deleteClickUpWebhookBestEffort({ webhookId: entry.state?.webhookId, clickupClient: entry.clickupClient, worktree: entry.worktree, reason });
9386
- if (deleteResult.ok) markClickUpWebhookInactive(entry.worktree, entry.state, entry.config);
9385
+ const preservedResult = { ok: true, skipped: true, reason: "remote_webhook_preserved" };
9386
+ clickUpWebhookLifecycleLog(entry.worktree, { type: "remote_webhook_preserved", reason, webhookId: entry.state?.webhookId });
9387
+ markClickUpWebhookInactive(entry.worktree, entry.state, entry.config);
9387
9388
  activeClickUpWebhookLifecycleRegistry.delete(entry.key);
9388
- clickUpWebhookLifecycleLog(entry.worktree, { type: "cleanup_finished", reason, close_ok: closeResult.ok, delete_ok: deleteResult.ok, delete_reason: deleteResult.reason });
9389
- return { ok: closeResult.ok !== false && deleteResult.ok !== false, closeResult, deleteResult };
9389
+ clickUpWebhookLifecycleLog(entry.worktree, { type: "cleanup_finished", reason, close_ok: closeResult.ok, remote_webhook: "preserved" });
9390
+ return { ok: closeResult.ok !== false, closeResult, deleteResult: preservedResult, preserveResult: preservedResult };
9390
9391
  })();
9391
9392
  const result = await promiseWithTimeout(cleanup, timeoutMs, { ok: false, timeout: true, reason: "cleanup_timeout" });
9392
9393
  if (result?.timeout) clickUpWebhookLifecycleLog(entry.worktree, { type: "cleanup_timeout", reason, webhookId: entry.state?.webhookId });
@@ -10762,15 +10763,14 @@ async function OptimaPlugin(input = {}, pluginOptions = {}) {
10762
10763
  }, clickUpWebhookValidation.config);
10763
10764
  registerClickUpWebhookLifecycle({ config: clickUpWebhookValidation.config, state: activeState, worktree, clickupClient: lifecycleClickUpClient, listener: readyListener, listenerRegistry });
10764
10765
  } else {
10765
- await deleteClickUpWebhookBestEffort({ webhookId: listenerState.webhookId, clickupClient: lifecycleClickUpClient, worktree, reason: readyListener.reason || "listener_unavailable" });
10766
+ clickUpWebhookLifecycleLog(worktree, { type: "remote_webhook_preserved", reason: readyListener.reason || "listener_unavailable", webhookId: listenerState.webhookId });
10766
10767
  markClickUpWebhookInactive(worktree, listenerState, clickUpWebhookValidation.config);
10767
10768
  clickUpWebhookActive = false;
10768
10769
  clickUpWebhookRuntime = { ...clickUpWebhookRuntime, active: false, valid: false, reason: readyListener.reason || "listener_unavailable" };
10769
10770
  }
10770
10771
  } catch (error) {
10771
10772
  const failureState = clickUpWebhookRuntime.state || readClickUpWebhookState(worktree, clickUpWebhookValidation.config);
10772
- const failureClient = input.clickupClient || createClickUpApiClient(clickUpWebhookValidation.config, input.fetch);
10773
- await deleteClickUpWebhookBestEffort({ webhookId: failureState.webhookId, clickupClient: failureClient, worktree, reason: "listener_failed" });
10773
+ clickUpWebhookLifecycleLog(worktree, { type: "remote_webhook_preserved", reason: "listener_failed", webhookId: failureState.webhookId });
10774
10774
  markClickUpWebhookInactive(worktree, failureState, clickUpWebhookValidation.config);
10775
10775
  clickUpWebhookActive = false;
10776
10776
  clickUpWebhookRuntime = { ...clickUpWebhookRuntime, active: false, valid: false, reason: "listener_failed", error: error.message };
@@ -9389,11 +9389,12 @@ async function cleanupManagedClickUpWebhook(entry = {}, { timeoutMs = CLICKUP_WE
9389
9389
  clickUpWebhookLifecycleLog(entry.worktree, { type: "cleanup_started", reason, key: entry.key, webhookId: entry.state?.webhookId });
9390
9390
  const closeResult = await closeClickUpWebhookServer(entry.listener?.server);
9391
9391
  if (entry.listenerRegistry && entry.listener?.key) entry.listenerRegistry.delete(entry.listener.key);
9392
- const deleteResult = await deleteClickUpWebhookBestEffort({ webhookId: entry.state?.webhookId, clickupClient: entry.clickupClient, worktree: entry.worktree, reason });
9393
- if (deleteResult.ok) markClickUpWebhookInactive(entry.worktree, entry.state, entry.config);
9392
+ const preservedResult = { ok: true, skipped: true, reason: "remote_webhook_preserved" };
9393
+ clickUpWebhookLifecycleLog(entry.worktree, { type: "remote_webhook_preserved", reason, webhookId: entry.state?.webhookId });
9394
+ markClickUpWebhookInactive(entry.worktree, entry.state, entry.config);
9394
9395
  activeClickUpWebhookLifecycleRegistry.delete(entry.key);
9395
- clickUpWebhookLifecycleLog(entry.worktree, { type: "cleanup_finished", reason, close_ok: closeResult.ok, delete_ok: deleteResult.ok, delete_reason: deleteResult.reason });
9396
- return { ok: closeResult.ok !== false && deleteResult.ok !== false, closeResult, deleteResult };
9396
+ clickUpWebhookLifecycleLog(entry.worktree, { type: "cleanup_finished", reason, close_ok: closeResult.ok, remote_webhook: "preserved" });
9397
+ return { ok: closeResult.ok !== false, closeResult, deleteResult: preservedResult, preserveResult: preservedResult };
9397
9398
  })();
9398
9399
  const result = await promiseWithTimeout(cleanup, timeoutMs, { ok: false, timeout: true, reason: "cleanup_timeout" });
9399
9400
  if (result?.timeout) clickUpWebhookLifecycleLog(entry.worktree, { type: "cleanup_timeout", reason, webhookId: entry.state?.webhookId });
@@ -10769,15 +10770,14 @@ async function OptimaPlugin(input = {}, pluginOptions = {}) {
10769
10770
  }, clickUpWebhookValidation.config);
10770
10771
  registerClickUpWebhookLifecycle({ config: clickUpWebhookValidation.config, state: activeState, worktree, clickupClient: lifecycleClickUpClient, listener: readyListener, listenerRegistry });
10771
10772
  } else {
10772
- await deleteClickUpWebhookBestEffort({ webhookId: listenerState.webhookId, clickupClient: lifecycleClickUpClient, worktree, reason: readyListener.reason || "listener_unavailable" });
10773
+ clickUpWebhookLifecycleLog(worktree, { type: "remote_webhook_preserved", reason: readyListener.reason || "listener_unavailable", webhookId: listenerState.webhookId });
10773
10774
  markClickUpWebhookInactive(worktree, listenerState, clickUpWebhookValidation.config);
10774
10775
  clickUpWebhookActive = false;
10775
10776
  clickUpWebhookRuntime = { ...clickUpWebhookRuntime, active: false, valid: false, reason: readyListener.reason || "listener_unavailable" };
10776
10777
  }
10777
10778
  } catch (error) {
10778
10779
  const failureState = clickUpWebhookRuntime.state || readClickUpWebhookState(worktree, clickUpWebhookValidation.config);
10779
- const failureClient = input.clickupClient || createClickUpApiClient(clickUpWebhookValidation.config, input.fetch);
10780
- await deleteClickUpWebhookBestEffort({ webhookId: failureState.webhookId, clickupClient: failureClient, worktree, reason: "listener_failed" });
10780
+ clickUpWebhookLifecycleLog(worktree, { type: "remote_webhook_preserved", reason: "listener_failed", webhookId: failureState.webhookId });
10781
10781
  markClickUpWebhookInactive(worktree, failureState, clickUpWebhookValidation.config);
10782
10782
  clickUpWebhookActive = false;
10783
10783
  clickUpWebhookRuntime = { ...clickUpWebhookRuntime, active: false, valid: false, reason: "listener_failed", error: error.message };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defend-tech/opencode-optima",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@github.com/defend-tech/opencode-optima.git"