@doingdev/opencode-claude-manager-plugin 0.1.62 → 0.1.64

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.
@@ -15,6 +15,14 @@ interface ClaudeManagerPluginServices {
15
15
  }
16
16
  export declare function getOrCreatePluginServices(worktree: string): ClaudeManagerPluginServices;
17
17
  export declare function clearPluginServices(): void;
18
+ export declare function isRevertAlreadyProcessed(ctoSessionId: string, revertMessageId: string): boolean;
19
+ export declare function markRevertProcessed(ctoSessionId: string, revertMessageId: string): void;
20
+ export declare function clearRevertProcessed(ctoSessionId: string, revertMessageId: string): void;
21
+ /**
22
+ * Clear the latest dedup entry for a CTO session — called when the revert marker disappears
23
+ * so that a subsequent undo of the same message can be processed again.
24
+ */
25
+ export declare function clearLatestRevertProcessed(ctoSessionId: string): void;
18
26
  export declare function registerParentSession(childId: string, parentId: string): void;
19
27
  export declare function getParentSessionId(childId: string): string | undefined;
20
28
  export declare function registerSessionTeam(sessionId: string, teamId: string): void;
@@ -15,6 +15,15 @@ const wrapperSessionRegistry = new Map();
15
15
  const parentSessionRegistry = new Map();
16
16
  /** ctoSessionId → teamId — populated when a CTO chat.message fires */
17
17
  const sessionTeamRegistry = new Map();
18
+ /**
19
+ * Dedupe set for processed CTO undo events.
20
+ * Key format: "${ctoSessionId}:${revertMessageId}".
21
+ * Cleared when the session no longer shows a revert marker (via a subsequent session.updated
22
+ * with no revert field) or on a full service reset.
23
+ */
24
+ const processedRevertRegistry = new Set();
25
+ /** ctoSessionId → latest processed revertMessageId — used to clear stale dedup entries when the revert marker disappears */
26
+ const latestRevertRegistry = new Map();
18
27
  export function getOrCreatePluginServices(worktree) {
19
28
  const existing = serviceRegistry.get(worktree);
20
29
  if (existing) {
@@ -48,6 +57,29 @@ export function clearPluginServices() {
48
57
  wrapperSessionRegistry.clear();
49
58
  parentSessionRegistry.clear();
50
59
  sessionTeamRegistry.clear();
60
+ processedRevertRegistry.clear();
61
+ latestRevertRegistry.clear();
62
+ }
63
+ export function isRevertAlreadyProcessed(ctoSessionId, revertMessageId) {
64
+ return processedRevertRegistry.has(`${ctoSessionId}:${revertMessageId}`);
65
+ }
66
+ export function markRevertProcessed(ctoSessionId, revertMessageId) {
67
+ processedRevertRegistry.add(`${ctoSessionId}:${revertMessageId}`);
68
+ latestRevertRegistry.set(ctoSessionId, revertMessageId);
69
+ }
70
+ export function clearRevertProcessed(ctoSessionId, revertMessageId) {
71
+ processedRevertRegistry.delete(`${ctoSessionId}:${revertMessageId}`);
72
+ }
73
+ /**
74
+ * Clear the latest dedup entry for a CTO session — called when the revert marker disappears
75
+ * so that a subsequent undo of the same message can be processed again.
76
+ */
77
+ export function clearLatestRevertProcessed(ctoSessionId) {
78
+ const revertMessageId = latestRevertRegistry.get(ctoSessionId);
79
+ if (revertMessageId !== undefined) {
80
+ processedRevertRegistry.delete(`${ctoSessionId}:${revertMessageId}`);
81
+ latestRevertRegistry.delete(ctoSessionId);
82
+ }
51
83
  }
52
84
  export function registerParentSession(childId, parentId) {
53
85
  parentSessionRegistry.set(childId, parentId);
@@ -1,5 +1,4 @@
1
1
  import { PLANNER_ELIGIBLE_ENGINEERS, type EngineerName, type TeamEngineerRecord, type TeamRecord } from '../types/contracts.js';
2
- export declare const TEAM_ENGINEERS: readonly ["Tom", "John", "Maya", "Sara", "Alex", "BrowserQA"];
3
2
  export { PLANNER_ELIGIBLE_ENGINEERS };
4
3
  export declare function isEngineerName(value: string): value is EngineerName;
5
4
  export declare function createEmptyTeamRecord(teamId: string, cwd: string): TeamRecord;
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_ENGINEER_NAMES, PLANNER_ELIGIBLE_ENGINEERS, } from '../types/contracts.js';
2
- export const TEAM_ENGINEERS = DEFAULT_ENGINEER_NAMES;
2
+ const TEAM_ENGINEERS = DEFAULT_ENGINEER_NAMES;
3
3
  export { PLANNER_ELIGIBLE_ENGINEERS };
4
4
  export function isEngineerName(value) {
5
5
  return TEAM_ENGINEERS.includes(value);
@@ -1,5 +1,4 @@
1
1
  import { PLANNER_ELIGIBLE_ENGINEERS, type EngineerName, type TeamEngineerRecord, type TeamRecord } from '../types/contracts.js';
2
- export declare const TEAM_ENGINEERS: readonly ["Tom", "John", "Maya", "Sara", "Alex", "BrowserQA"];
3
2
  export { PLANNER_ELIGIBLE_ENGINEERS };
4
3
  export declare function isEngineerName(value: string): value is EngineerName;
5
4
  export declare function createEmptyTeamRecord(teamId: string, cwd: string): TeamRecord;
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_ENGINEER_NAMES, PLANNER_ELIGIBLE_ENGINEERS, } from '../types/contracts.js';
2
- export const TEAM_ENGINEERS = DEFAULT_ENGINEER_NAMES;
2
+ const TEAM_ENGINEERS = DEFAULT_ENGINEER_NAMES;
3
3
  export { PLANNER_ELIGIBLE_ENGINEERS };
4
4
  export function isEngineerName(value) {
5
5
  return TEAM_ENGINEERS.includes(value);
@@ -0,0 +1 @@
1
+ export {};