opencode-acp 1.0.0

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 (137) hide show
  1. package/LICENSE +622 -0
  2. package/README.md +340 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +8261 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/auth.d.ts +4 -0
  8. package/dist/lib/auth.d.ts.map +1 -0
  9. package/dist/lib/commands/compression-targets.d.ts +14 -0
  10. package/dist/lib/commands/compression-targets.d.ts.map +1 -0
  11. package/dist/lib/commands/context.d.ts +52 -0
  12. package/dist/lib/commands/context.d.ts.map +1 -0
  13. package/dist/lib/commands/decompress.d.ts +12 -0
  14. package/dist/lib/commands/decompress.d.ts.map +1 -0
  15. package/dist/lib/commands/help.d.ts +17 -0
  16. package/dist/lib/commands/help.d.ts.map +1 -0
  17. package/dist/lib/commands/index.d.ts +8 -0
  18. package/dist/lib/commands/index.d.ts.map +1 -0
  19. package/dist/lib/commands/manual.d.ts +23 -0
  20. package/dist/lib/commands/manual.d.ts.map +1 -0
  21. package/dist/lib/commands/recompress.d.ts +12 -0
  22. package/dist/lib/commands/recompress.d.ts.map +1 -0
  23. package/dist/lib/commands/stats.d.ts +15 -0
  24. package/dist/lib/commands/stats.d.ts.map +1 -0
  25. package/dist/lib/commands/sweep.d.ts +23 -0
  26. package/dist/lib/commands/sweep.d.ts.map +1 -0
  27. package/dist/lib/compress/index.d.ts +4 -0
  28. package/dist/lib/compress/index.d.ts.map +1 -0
  29. package/dist/lib/compress/message-utils.d.ts +8 -0
  30. package/dist/lib/compress/message-utils.d.ts.map +1 -0
  31. package/dist/lib/compress/message.d.ts +4 -0
  32. package/dist/lib/compress/message.d.ts.map +1 -0
  33. package/dist/lib/compress/pipeline.d.ts +29 -0
  34. package/dist/lib/compress/pipeline.d.ts.map +1 -0
  35. package/dist/lib/compress/protected-content.d.ts +7 -0
  36. package/dist/lib/compress/protected-content.d.ts.map +1 -0
  37. package/dist/lib/compress/range-utils.d.ts +10 -0
  38. package/dist/lib/compress/range-utils.d.ts.map +1 -0
  39. package/dist/lib/compress/range.d.ts +4 -0
  40. package/dist/lib/compress/range.d.ts.map +1 -0
  41. package/dist/lib/compress/search.d.ts +11 -0
  42. package/dist/lib/compress/search.d.ts.map +1 -0
  43. package/dist/lib/compress/state.d.ts +10 -0
  44. package/dist/lib/compress/state.d.ts.map +1 -0
  45. package/dist/lib/compress/timing.d.ts +18 -0
  46. package/dist/lib/compress/timing.d.ts.map +1 -0
  47. package/dist/lib/compress/types.d.ts +94 -0
  48. package/dist/lib/compress/types.d.ts.map +1 -0
  49. package/dist/lib/compress-permission.d.ts +6 -0
  50. package/dist/lib/compress-permission.d.ts.map +1 -0
  51. package/dist/lib/config.d.ts +80 -0
  52. package/dist/lib/config.d.ts.map +1 -0
  53. package/dist/lib/gc/truncate.d.ts +15 -0
  54. package/dist/lib/gc/truncate.d.ts.map +1 -0
  55. package/dist/lib/hooks.d.ts +38 -0
  56. package/dist/lib/hooks.d.ts.map +1 -0
  57. package/dist/lib/host-permissions.d.ts +11 -0
  58. package/dist/lib/host-permissions.d.ts.map +1 -0
  59. package/dist/lib/logger.d.ts +31 -0
  60. package/dist/lib/logger.d.ts.map +1 -0
  61. package/dist/lib/message-ids.d.ts +19 -0
  62. package/dist/lib/message-ids.d.ts.map +1 -0
  63. package/dist/lib/messages/index.d.ts +10 -0
  64. package/dist/lib/messages/index.d.ts.map +1 -0
  65. package/dist/lib/messages/inject/inject.d.ts +8 -0
  66. package/dist/lib/messages/inject/inject.d.ts.map +1 -0
  67. package/dist/lib/messages/inject/subagent-results.d.ts +4 -0
  68. package/dist/lib/messages/inject/subagent-results.d.ts.map +1 -0
  69. package/dist/lib/messages/inject/utils.d.ts +33 -0
  70. package/dist/lib/messages/inject/utils.d.ts.map +1 -0
  71. package/dist/lib/messages/priority.d.ts +13 -0
  72. package/dist/lib/messages/priority.d.ts.map +1 -0
  73. package/dist/lib/messages/prune.d.ts +5 -0
  74. package/dist/lib/messages/prune.d.ts.map +1 -0
  75. package/dist/lib/messages/query.d.ts +7 -0
  76. package/dist/lib/messages/query.d.ts.map +1 -0
  77. package/dist/lib/messages/reasoning-strip.d.ts +8 -0
  78. package/dist/lib/messages/reasoning-strip.d.ts.map +1 -0
  79. package/dist/lib/messages/shape.d.ts +5 -0
  80. package/dist/lib/messages/shape.d.ts.map +1 -0
  81. package/dist/lib/messages/sync.d.ts +4 -0
  82. package/dist/lib/messages/sync.d.ts.map +1 -0
  83. package/dist/lib/messages/utils.d.ts +28 -0
  84. package/dist/lib/messages/utils.d.ts.map +1 -0
  85. package/dist/lib/prompts/compress-message.d.ts +2 -0
  86. package/dist/lib/prompts/compress-message.d.ts.map +1 -0
  87. package/dist/lib/prompts/compress-range.d.ts +2 -0
  88. package/dist/lib/prompts/compress-range.d.ts.map +1 -0
  89. package/dist/lib/prompts/context-limit-nudge.d.ts +2 -0
  90. package/dist/lib/prompts/context-limit-nudge.d.ts.map +1 -0
  91. package/dist/lib/prompts/extensions/nudge.d.ts +10 -0
  92. package/dist/lib/prompts/extensions/nudge.d.ts.map +1 -0
  93. package/dist/lib/prompts/extensions/system.d.ts +4 -0
  94. package/dist/lib/prompts/extensions/system.d.ts.map +1 -0
  95. package/dist/lib/prompts/extensions/tool.d.ts +3 -0
  96. package/dist/lib/prompts/extensions/tool.d.ts.map +1 -0
  97. package/dist/lib/prompts/index.d.ts +4 -0
  98. package/dist/lib/prompts/index.d.ts.map +1 -0
  99. package/dist/lib/prompts/iteration-nudge.d.ts +2 -0
  100. package/dist/lib/prompts/iteration-nudge.d.ts.map +1 -0
  101. package/dist/lib/prompts/store.d.ts +25 -0
  102. package/dist/lib/prompts/store.d.ts.map +1 -0
  103. package/dist/lib/prompts/system.d.ts +2 -0
  104. package/dist/lib/prompts/system.d.ts.map +1 -0
  105. package/dist/lib/prompts/turn-nudge.d.ts +2 -0
  106. package/dist/lib/prompts/turn-nudge.d.ts.map +1 -0
  107. package/dist/lib/protected-patterns.d.ts +5 -0
  108. package/dist/lib/protected-patterns.d.ts.map +1 -0
  109. package/dist/lib/state/index.d.ts +5 -0
  110. package/dist/lib/state/index.d.ts.map +1 -0
  111. package/dist/lib/state/persistence.d.ts +49 -0
  112. package/dist/lib/state/persistence.d.ts.map +1 -0
  113. package/dist/lib/state/state.d.ts +7 -0
  114. package/dist/lib/state/state.d.ts.map +1 -0
  115. package/dist/lib/state/tool-cache.d.ts +13 -0
  116. package/dist/lib/state/tool-cache.d.ts.map +1 -0
  117. package/dist/lib/state/types.d.ts +102 -0
  118. package/dist/lib/state/types.d.ts.map +1 -0
  119. package/dist/lib/state/utils.d.ts +22 -0
  120. package/dist/lib/state/utils.d.ts.map +1 -0
  121. package/dist/lib/strategies/deduplication.d.ts +10 -0
  122. package/dist/lib/strategies/deduplication.d.ts.map +1 -0
  123. package/dist/lib/strategies/index.d.ts +3 -0
  124. package/dist/lib/strategies/index.d.ts.map +1 -0
  125. package/dist/lib/strategies/purge-errors.d.ts +13 -0
  126. package/dist/lib/strategies/purge-errors.d.ts.map +1 -0
  127. package/dist/lib/subagents/subagent-results.d.ts +5 -0
  128. package/dist/lib/subagents/subagent-results.d.ts.map +1 -0
  129. package/dist/lib/token-utils.d.ts +19 -0
  130. package/dist/lib/token-utils.d.ts.map +1 -0
  131. package/dist/lib/ui/notification.d.ts +17 -0
  132. package/dist/lib/ui/notification.d.ts.map +1 -0
  133. package/dist/lib/ui/utils.d.ts +10 -0
  134. package/dist/lib/ui/utils.d.ts.map +1 -0
  135. package/dist/lib/update.d.ts +22 -0
  136. package/dist/lib/update.d.ts.map +1 -0
  137. package/package.json +75 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncate.d.ts","sourceRoot":"","sources":["../../../lib/gc/truncate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,MAAM,WAAW,gBAAgB;IAC7B,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,QAAQ;IACrB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;CACxB;AAED,wBAAgB,aAAa,CACzB,MAAM,EAAE,gBAAgB,EAAE,EAC1B,MAAM,EAAE,QAAQ,GACjB,gBAAgB,CAoBlB;AAqBD,wBAAgB,gBAAgB,CAC5B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,GAAG,SAAS,EACrC,QAAQ,EAAE,QAAQ,GACnB,OAAO,CAKT;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,QAAQ,CAM1G"}
@@ -0,0 +1,38 @@
1
+ import type { SessionState, WithParts } from "./state";
2
+ import type { Logger } from "./logger";
3
+ import type { PluginConfig } from "./config";
4
+ import { type PromptStore } from "./prompts";
5
+ import { type HostPermissionSnapshot } from "./host-permissions";
6
+ export declare function createSystemPromptHandler(state: SessionState, logger: Logger, config: PluginConfig, prompts: PromptStore): (input: {
7
+ sessionID?: string;
8
+ model: {
9
+ limit: {
10
+ context: number;
11
+ input?: number;
12
+ output?: number;
13
+ };
14
+ };
15
+ }, output: {
16
+ system: string[];
17
+ }) => Promise<void>;
18
+ export declare function createChatMessageTransformHandler(client: any, state: SessionState, logger: Logger, config: PluginConfig, prompts: PromptStore, hostPermissions: HostPermissionSnapshot): (input: {}, output: {
19
+ messages: WithParts[];
20
+ }) => Promise<void>;
21
+ export declare function createCommandExecuteHandler(client: any, state: SessionState, logger: Logger, config: PluginConfig, workingDirectory: string, hostPermissions: HostPermissionSnapshot): (input: {
22
+ command: string;
23
+ sessionID: string;
24
+ arguments: string;
25
+ }, output: {
26
+ parts: any[];
27
+ }) => Promise<void>;
28
+ export declare function createTextCompleteHandler(): (_input: {
29
+ sessionID: string;
30
+ messageID: string;
31
+ partID: string;
32
+ }, output: {
33
+ text: string;
34
+ }) => Promise<void>;
35
+ export declare function createEventHandler(state: SessionState, logger: Logger): (input: {
36
+ event: any;
37
+ }) => Promise<void>;
38
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../lib/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAe5C,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AAoBhE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAchE,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,IAGhB,OAAO;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE;QAAE,KAAK,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CACzE,EACD,QAAQ;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,mBAuCnC;AAuFD,wBAAgB,iCAAiC,CAC7C,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,EACpB,eAAe,EAAE,sBAAsB,IAEzB,OAAO,EAAE,EAAE,QAAQ;IAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,mBAyD7D;AAED,wBAAgB,2BAA2B,CACvC,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,EACpB,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,sBAAsB,IAGnC,OAAO;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAChE,QAAQ;IAAE,KAAK,EAAE,GAAG,EAAE,CAAA;CAAE,mBA0G/B;AAED,wBAAgB,yBAAyB,KAEjC,QAAQ;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAChE,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,mBAI/B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,IACpD,OAAO;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,mBAiFtC"}
@@ -0,0 +1,11 @@
1
+ export type PermissionAction = "ask" | "allow" | "deny";
2
+ export type PermissionValue = PermissionAction | Record<string, PermissionAction>;
3
+ export type PermissionConfig = Record<string, PermissionValue> | undefined;
4
+ export interface HostPermissionSnapshot {
5
+ global: PermissionConfig;
6
+ agents: Record<string, PermissionConfig>;
7
+ }
8
+ export declare const compressDisabledByOpencode: (...permissionConfigs: PermissionConfig[]) => boolean;
9
+ export declare const resolveEffectiveCompressPermission: (basePermission: PermissionAction, hostPermissions: HostPermissionSnapshot, agentName?: string) => PermissionAction;
10
+ export declare const hasExplicitToolPermission: (permissionConfig: PermissionConfig, tool: string) => boolean;
11
+ //# sourceMappingURL=host-permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-permissions.d.ts","sourceRoot":"","sources":["../../lib/host-permissions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAA;AAEvD,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;AAEjF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,CAAA;AAE1E,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,gBAAgB,CAAA;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CAC3C;AA6DD,eAAO,MAAM,0BAA0B,GAAI,GAAG,mBAAmB,gBAAgB,EAAE,KAAG,OAMrF,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC3C,gBAAgB,gBAAgB,EAChC,iBAAiB,sBAAsB,EACvC,YAAY,MAAM,KACnB,gBAWF,CAAA;AAED,eAAO,MAAM,yBAAyB,GAClC,kBAAkB,gBAAgB,EAClC,MAAM,MAAM,KACb,OAEF,CAAA"}
@@ -0,0 +1,31 @@
1
+ export declare class Logger {
2
+ private logDir;
3
+ enabled: boolean;
4
+ constructor(enabled: boolean);
5
+ private ensureLogDir;
6
+ private formatData;
7
+ private getCallerFile;
8
+ private write;
9
+ info(message: string, data?: any): Promise<void> | undefined;
10
+ debug(message: string, data?: any): Promise<void> | undefined;
11
+ warn(message: string, data?: any): Promise<void> | undefined;
12
+ error(message: string, data?: any): Promise<void> | undefined;
13
+ /**
14
+ * Strips unnecessary metadata from messages for cleaner debug logs.
15
+ *
16
+ * Removed:
17
+ * - All IDs (id, sessionID, messageID, parentID)
18
+ * - summary, path, cost, model, agent, mode, finish, providerID, modelID
19
+ * - step-start and step-finish parts entirely
20
+ * - snapshot fields
21
+ * - ignored text parts
22
+ *
23
+ * Kept:
24
+ * - role, time (created only), tokens (input, output, reasoning, cache)
25
+ * - text, reasoning, tool parts with content
26
+ * - tool calls with: tool, callID, input, output, metadata
27
+ */
28
+ private minimizeForDebug;
29
+ saveContext(sessionId: string, messages: any[]): Promise<void>;
30
+ }
31
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/logger.ts"],"names":[],"mappings":"AAKA,qBAAa,MAAM;IACf,OAAO,CAAC,MAAM,CAAQ;IACf,OAAO,EAAE,OAAO,CAAA;gBAEX,OAAO,EAAE,OAAO;YAMd,YAAY;IAM1B,OAAO,CAAC,UAAU;IAyBlB,OAAO,CAAC,aAAa;YAuBP,KAAK;IAqBnB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;IAMhC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;IAMjC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;IAMhC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;IAMjC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,gBAAgB;IAmFlB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE;CAiBvD"}
@@ -0,0 +1,19 @@
1
+ import type { SessionState, WithParts } from "./state";
2
+ export declare const MESSAGE_REF_MAX_INDEX = 9999;
3
+ export type ParsedBoundaryId = {
4
+ kind: "message";
5
+ ref: string;
6
+ index: number;
7
+ } | {
8
+ kind: "compressed-block";
9
+ ref: string;
10
+ blockId: number;
11
+ };
12
+ export declare function formatMessageRef(index: number): string;
13
+ export declare function formatBlockRef(blockId: number): string;
14
+ export declare function parseMessageRef(ref: string): number | null;
15
+ export declare function parseBlockRef(ref: string): number | null;
16
+ export declare function parseBoundaryId(id: string): ParsedBoundaryId | null;
17
+ export declare function formatMessageIdTag(ref: string, attributes?: Record<string, string | undefined>): string;
18
+ export declare function assignMessageRefs(state: SessionState, messages: WithParts[]): number;
19
+ //# sourceMappingURL=message-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-ids.d.ts","sourceRoot":"","sources":["../../lib/message-ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAStD,eAAO,MAAM,qBAAqB,OAAO,CAAA;AAEzC,MAAM,MAAM,gBAAgB,GACtB;IACI,IAAI,EAAE,SAAS,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CAChB,GACD;IACI,IAAI,EAAE,kBAAkB,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA;AAEP,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWtD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAc1D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQxD;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAqBnE;AAUD,wBAAgB,kBAAkB,CAC9B,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAChD,MAAM,CAaR;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAsCpF"}
@@ -0,0 +1,10 @@
1
+ export { prune } from "./prune";
2
+ export { syncCompressionBlocks } from "./sync";
3
+ export { injectCompressNudges } from "./inject/inject";
4
+ export { computeInputBudget } from "./inject/utils";
5
+ export { injectMessageIds } from "./inject/inject";
6
+ export { injectExtendedSubAgentResults } from "./inject/subagent-results";
7
+ export { stripStaleMetadata } from "./reasoning-strip";
8
+ export { buildPriorityMap } from "./priority";
9
+ export { buildToolIdList, stripHallucinations, stripHallucinationsFromString } from "./utils";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { SessionState, WithParts } from "../../state";
2
+ import type { Logger } from "../../logger";
3
+ import type { PluginConfig } from "../../config";
4
+ import type { RuntimePrompts } from "../../prompts/store";
5
+ import type { CompressionPriorityMap } from "../priority";
6
+ export declare const injectCompressNudges: (state: SessionState, config: PluginConfig, logger: Logger, messages: WithParts[], prompts: RuntimePrompts, compressionPriorities?: CompressionPriorityMap) => void;
7
+ export declare const injectMessageIds: (state: SessionState, config: PluginConfig, messages: WithParts[], compressionPriorities?: CompressionPriorityMap) => void;
8
+ //# sourceMappingURL=inject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../../../lib/messages/inject/inject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AA4BzD,eAAO,MAAM,oBAAoB,GAC7B,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,EACrB,SAAS,cAAc,EACvB,wBAAwB,sBAAsB,KAC/C,IAmHF,CAAA;AAsDD,eAAO,MAAM,gBAAgB,GACzB,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,UAAU,SAAS,EAAE,EACrB,wBAAwB,sBAAsB,KAC/C,IAiEF,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Logger } from "../../logger";
2
+ import type { SessionState, WithParts } from "../../state";
3
+ export declare const injectExtendedSubAgentResults: (client: any, state: SessionState, logger: Logger, messages: WithParts[], allowSubAgents: boolean) => Promise<void>;
4
+ //# sourceMappingURL=subagent-results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subagent-results.d.ts","sourceRoot":"","sources":["../../../../lib/messages/inject/subagent-results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAiB1D,eAAO,MAAM,6BAA6B,GACtC,QAAQ,GAAG,EACX,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,EACrB,gBAAgB,OAAO,KACxB,OAAO,CAAC,IAAI,CAyDd,CAAA"}
@@ -0,0 +1,33 @@
1
+ import type { SessionState, WithParts } from "../../state";
2
+ import type { PluginConfig } from "../../config";
3
+ import type { RuntimePrompts } from "../../prompts/store";
4
+ import { type CompressionPriorityMap } from "../priority";
5
+ export interface LastUserModelContext {
6
+ providerId: string | undefined;
7
+ modelId: string | undefined;
8
+ }
9
+ export interface LastNonIgnoredMessage {
10
+ message: WithParts;
11
+ index: number;
12
+ }
13
+ interface ModelLimit {
14
+ context: number;
15
+ input?: number;
16
+ output?: number;
17
+ }
18
+ export declare function computeInputBudget(limit: ModelLimit): number | undefined;
19
+ export declare function getNudgeFrequency(config: PluginConfig): number;
20
+ export declare function getIterationNudgeThreshold(config: PluginConfig): number;
21
+ export declare function findLastNonIgnoredMessage(messages: WithParts[]): LastNonIgnoredMessage | null;
22
+ export declare function countMessagesAfterIndex(messages: WithParts[], index: number): number;
23
+ export declare function getModelInfo(messages: WithParts[]): LastUserModelContext;
24
+ export declare function isContextOverLimits(config: PluginConfig, state: SessionState, providerId: string | undefined, modelId: string | undefined, messages: WithParts[]): {
25
+ overMaxLimit: boolean;
26
+ overMinLimit: boolean;
27
+ currentTokens: number;
28
+ modelContextLimit: number | undefined;
29
+ };
30
+ export declare function addAnchor(anchorMessageIds: Set<string>, anchorMessageId: string, anchorMessageIndex: number, messages: WithParts[], interval: number): boolean;
31
+ export declare function applyAnchoredNudges(state: SessionState, config: PluginConfig, messages: WithParts[], prompts: RuntimePrompts, compressionPriorities?: CompressionPriorityMap, currentTokens?: number, modelContextLimit?: number): void;
32
+ export {};
33
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../lib/messages/inject/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAMhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EACH,KAAK,sBAAsB,EAG9B,MAAM,aAAa,CAAA;AAapB,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B;AAED,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,SAAS,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,UAAU,UAAU;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAMxE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE9D;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAEvE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,qBAAqB,GAAG,IAAI,CAU7F;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAYpF;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,oBAAoB,CAcxE;AA+CD,wBAAgB,mBAAmB,CAC/B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,SAAS,EAAE;;;;;EA6CxB;AAED,wBAAgB,SAAS,CACrB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC7B,eAAe,EAAE,MAAM,EACvB,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,EAAE,SAAS,EAAE,EACrB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAsBT;AA4ID,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,SAAS,EAAE,EACrB,OAAO,EAAE,cAAc,EACvB,qBAAqB,CAAC,EAAE,sBAAsB,EAC9C,aAAa,CAAC,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,MAAM,GAC3B,IAAI,CA6CN"}
@@ -0,0 +1,13 @@
1
+ import type { PluginConfig } from "../config";
2
+ import type { SessionState, WithParts } from "../state";
3
+ export type MessagePriority = "low" | "medium" | "high";
4
+ export interface CompressionPriorityEntry {
5
+ ref: string;
6
+ tokenCount: number;
7
+ priority: MessagePriority;
8
+ }
9
+ export type CompressionPriorityMap = Map<string, CompressionPriorityEntry>;
10
+ export declare function buildPriorityMap(config: PluginConfig, state: SessionState, messages: WithParts[]): CompressionPriorityMap;
11
+ export declare function classifyMessagePriority(tokenCount: number): MessagePriority;
12
+ export declare function listPriorityRefsBeforeIndex(messages: WithParts[], priorities: CompressionPriorityMap, anchorIndex: number, priority: MessagePriority): string[];
13
+ //# sourceMappingURL=priority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"priority.d.ts","sourceRoot":"","sources":["../../../lib/messages/priority.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAMvD,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEvD,MAAM,WAAW,wBAAwB;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,eAAe,CAAA;CAC5B;AAED,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAA;AAE1E,wBAAgB,gBAAgB,CAC5B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,SAAS,EAAE,GACtB,sBAAsB,CAsCxB;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAU3E;AAED,wBAAgB,2BAA2B,CACvC,QAAQ,EAAE,SAAS,EAAE,EACrB,UAAU,EAAE,sBAAsB,EAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,eAAe,GAC1B,MAAM,EAAE,CAqBV"}
@@ -0,0 +1,5 @@
1
+ import type { SessionState, WithParts } from "../state";
2
+ import type { Logger } from "../logger";
3
+ import type { PluginConfig } from "../config";
4
+ export declare const prune: (state: SessionState, logger: Logger, config: PluginConfig, messages: WithParts[]) => void;
5
+ //# sourceMappingURL=prune.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAW7C,eAAO,MAAM,KAAK,GACd,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,QAAQ,YAAY,EACpB,UAAU,SAAS,EAAE,KACtB,IAMF,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { PluginConfig } from "../config";
2
+ import type { WithParts } from "../state";
3
+ export declare const getLastUserMessage: (messages: WithParts[], startIndex?: number) => WithParts | null;
4
+ export declare const messageHasCompress: (message: WithParts) => boolean;
5
+ export declare const isIgnoredUserMessage: (message: WithParts) => boolean;
6
+ export declare function isProtectedUserMessage(config: PluginConfig, message: WithParts): boolean;
7
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../lib/messages/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC,eAAO,MAAM,kBAAkB,GAC3B,UAAU,SAAS,EAAE,EACrB,aAAa,MAAM,KACpB,SAAS,GAAG,IAYd,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,SAAS,SAAS,KAAG,OAcvD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,SAAS,SAAS,KAAG,OAqBzD,CAAA;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAWxF"}
@@ -0,0 +1,8 @@
1
+ import type { WithParts } from "../state";
2
+ /**
3
+ * Mirrors opencode's differentModel handling by preserving part content while
4
+ * dropping provider metadata on assistant parts that came from a different
5
+ * model/provider than the current turn's user message.
6
+ */
7
+ export declare function stripStaleMetadata(messages: WithParts[]): void;
8
+ //# sourceMappingURL=reasoning-strip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-strip.d.ts","sourceRoot":"","sources":["../../../lib/messages/reasoning-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAkC9D"}
@@ -0,0 +1,5 @@
1
+ import type { WithParts } from "../state";
2
+ export declare function isMessageWithInfo(message: unknown): message is WithParts;
3
+ export declare function filterMessages(messages: unknown): WithParts[];
4
+ export declare function filterMessagesInPlace(messages: unknown): WithParts[];
5
+ //# sourceMappingURL=shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../../lib/messages/shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,SAAS,CAsBxE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,CAM7D;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,CAepE"}
@@ -0,0 +1,4 @@
1
+ import type { SessionState, WithParts } from "../state";
2
+ import type { Logger } from "../logger";
3
+ export declare const syncCompressionBlocks: (state: SessionState, logger: Logger, messages: WithParts[]) => void;
4
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../lib/messages/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAavC,eAAO,MAAM,qBAAqB,GAC9B,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,KACtB,IA+GF,CAAA"}
@@ -0,0 +1,28 @@
1
+ import type { SessionState, WithParts } from "../state";
2
+ export declare const createSyntheticUserMessage: (baseMessage: WithParts, content: string, stableSeed?: string) => WithParts;
3
+ export declare const createSyntheticTextPart: (baseMessage: WithParts, content: string, stableSeed?: string) => {
4
+ id: string;
5
+ sessionID: string;
6
+ messageID: string;
7
+ type: "text";
8
+ text: string;
9
+ };
10
+ type MessagePart = WithParts["parts"][number];
11
+ type ToolPart = Extract<MessagePart, {
12
+ type: "tool";
13
+ }>;
14
+ type TextPart = Extract<MessagePart, {
15
+ type: "text";
16
+ }>;
17
+ export declare const appendToLastTextPart: (message: WithParts, injection: string) => boolean;
18
+ export declare const appendToTextPart: (part: TextPart, injection: string) => boolean;
19
+ export declare const appendToAllToolParts: (message: WithParts, tag: string) => boolean;
20
+ export declare const appendToToolPart: (part: ToolPart, tag: string) => boolean;
21
+ export declare const hasContent: (message: WithParts) => boolean;
22
+ export declare function buildToolIdList(state: SessionState, messages: WithParts[]): string[];
23
+ export declare const replaceBlockIdsWithBlocked: (text: string) => string;
24
+ export declare const stripStaleMessageRefs: (text: string) => string;
25
+ export declare const stripHallucinationsFromString: (text: string) => string;
26
+ export declare const stripHallucinations: (messages: WithParts[]) => void;
27
+ export {};
28
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/messages/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAgBvD,eAAO,MAAM,0BAA0B,GACnC,aAAa,SAAS,EACtB,SAAS,MAAM,EACf,aAAa,MAAM,KACpB,SA0BF,CAAA;AAED,eAAO,MAAM,uBAAuB,GAChC,aAAa,SAAS,EACtB,SAAS,MAAM,EACf,aAAa,MAAM;;;;;;CAatB,CAAA;AAED,KAAK,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;AAC7C,KAAK,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AACtD,KAAK,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEtD,eAAO,MAAM,oBAAoB,GAAI,SAAS,SAAS,EAAE,WAAW,MAAM,KAAG,OAO5E,CAAA;AAaD,eAAO,MAAM,gBAAgB,GAAI,MAAM,QAAQ,EAAE,WAAW,MAAM,KAAG,OAgBpE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,SAAS,SAAS,EAAE,KAAK,MAAM,KAAG,OAQtE,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,MAAM,QAAQ,EAAE,KAAK,MAAM,KAAG,OAU9D,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,SAAS,SAAS,KAAG,OAU/C,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CAiBpF;AAED,eAAO,MAAM,0BAA0B,GAAI,MAAM,MAAM,KAAG,MAEzD,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,MAEpD,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAI,MAAM,MAAM,KAAG,MAE5D,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,UAAU,SAAS,EAAE,KAAG,IAgB3D,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const COMPRESS_MESSAGE = "Collapse selected individual messages in the conversation into detailed summaries.\n\nTHE SUMMARY\nYour summary must be EXHAUSTIVE. Capture file paths, function signatures, decisions made, constraints discovered, key findings, tool outcomes, and user intent details that matter... EVERYTHING that preserves the value of the selected message after the raw message is removed.\n\nUSER INTENT FIDELITY\nWhen a selected message contains user intent, preserve that intent with extra care. Do not change scope, constraints, priorities, acceptance criteria, or requested outcomes.\nDirectly quote short user instructions when that best preserves exact meaning.\n\nYet be LEAN. Strip away the noise: failed attempts that led nowhere, verbose tool output, and repetition. What remains should be pure signal - golden nuggets of detail that preserve full understanding with zero ambiguity.\nIf a message contains no significant technical decisions, code changes, or user requirements, produce a minimal one-line summary rather than a detailed one.\n\nMESSAGE IDS\nYou specify individual raw messages by ID using the injected IDs visible in the conversation:\n\n- `mNNNN` IDs identify raw messages\n\nEach message has an ID inside XML metadata tags like `<dcp-message-id priority=\"high\">m0007</dcp-message-id>`.\nThe same ID tag appears in every tool output of the message it belongs to \u2014 each unique ID identifies one complete message.\nTreat these tags as message metadata only, not as content to summarize. Use only the inner `mNNNN` value as the `messageId`.\nThe `priority` attribute indicates relative context cost. You MUST compress high-priority messages when their full text is no longer necessary for the active task.\nIf prior compress-tool results are present, always compress and summarize them minimally only as part of a broader compression pass. Do not invoke the compress tool solely to re-compress an earlier compression result.\nMessages marked as `<dcp-message-id>BLOCKED</dcp-message-id>` cannot be compressed.\n\nRules:\n\n- Pick each `messageId` directly from injected IDs visible in context.\n- Only use raw message IDs of the form `mNNNN`.\n- Ignore XML attributes such as `priority` when copying the ID; use only the inner `mNNNN` value.\n- Do not invent IDs. Use only IDs that are present in context.\n\nBATCHING\nSelect MANY messages in a single tool call when they are safe to compress.\nEach entry should summarize exactly one message, and the tool can receive as many entries as needed in one batch.\n\nGENERAL CLEANUP\nUse the topic \"general cleanup\" for broad cleanup passes.\nDuring general cleanup, compress all medium and high-priority messages that are not relevant to the active task.\nOptimize for reducing context footprint, not for grouping messages by topic.\nDo not compress away still-active instructions, unresolved questions, or constraints that are likely to matter soon.\nPrioritize the earliest messages in the context as they will be the least relevant to the active task.\nGeneral cleanup should be done periodically between other normal compression tool passes, not as the primary form of compression.\n";
2
+ //# sourceMappingURL=compress-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress-message.d.ts","sourceRoot":"","sources":["../../../lib/prompts/compress-message.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,qlGA0C5B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const COMPRESS_RANGE = "Collapse a range in the conversation into a detailed summary.\n\nTHE SUMMARY\nYour summary must be EXHAUSTIVE. Capture file paths, function signatures, decisions made, constraints discovered, key findings... EVERYTHING that maintains context integrity. This is not a brief note - it is an authoritative record so faithful that the original conversation adds no value.\n\nUSER INTENT FIDELITY\nWhen the compressed range includes user messages, preserve the user's intent with extra care. Do not change scope, constraints, priorities, acceptance criteria, or requested outcomes.\nDirectly quote user messages when they are short enough to include safely. Direct quotes are preferred when they best preserve exact meaning.\n\nYet be LEAN. Strip away the noise: failed attempts that led nowhere, verbose tool outputs, back-and-forth exploration. What remains should be pure signal - golden nuggets of detail that preserve full understanding with zero ambiguity.\n\nCOMPRESSED BLOCK PLACEHOLDERS\nWhen the selected range includes previously compressed blocks, use this exact placeholder format when referencing one:\n\n- `(bN)`\n\nCompressed block sections in context are clearly marked with a header:\n\n- `[Compressed conversation section]`\n\nCompressed block IDs always use the `bN` form (never `mNNNN`) and are represented in the same XML metadata tag format.\n\nRules:\n\n- Include every required block placeholder exactly once.\n- Do not invent placeholders for blocks outside the selected range.\n- Treat `(bN)` placeholders as RESERVED TOKENS. Do not emit `(bN)` text anywhere except intentional placeholders.\n- If you need to mention a block in prose, use plain text like `compressed bN` (not as a placeholder).\n- Preflight check before finalizing: the set of `(bN)` placeholders in your summary must exactly match the required set, with no duplicates.\n\nThese placeholders are semantic references. They will be replaced with the full stored compressed block content when the tool processes your output.\n\nFLOW PRESERVATION WITH PLACEHOLDERS\nWhen you use compressed block placeholders, write the surrounding summary text so it still reads correctly AFTER placeholder expansion.\n\n- Treat each placeholder as a stand-in for a full conversation segment, not as a short label.\n- Ensure transitions before and after each placeholder preserve chronology and causality.\n- Do not write text that depends on the placeholder staying literal (for example, \"as noted in `(b2)`\").\n- Your final meaning must be coherent once each placeholder is replaced with its full compressed block content.\n\nBOUNDARY IDS\nYou specify boundaries by ID using the injected IDs visible in the conversation:\n\n- `mNNNN` IDs identify raw messages\n- `bN` IDs identify previously compressed blocks\n\nEach message has an ID inside XML metadata tags like `<dcp-message-id>...</dcp-message-id>`.\nThe same ID tag appears in every tool output of the message it belongs to \u2014 each unique ID identifies one complete message.\nTreat these tags as boundary metadata only, not as tool result content.\n\nRules:\n\n- Pick `startId` and `endId` directly from injected IDs in context.\n- IDs must exist in the current visible context. If you cannot see an ID in the messages above, it is stale and will fail.\n- `startId` must appear before `endId`.\n- Do not invent IDs. Use only IDs that are present in context.\n- NEVER use IDs from compressed block summaries, previous nudges, or your own memory \u2014 only IDs currently visible as XML metadata tags in the conversation.\n\nBATCHING\nWhen multiple independent ranges are ready and their boundaries do not overlap, include all of them as separate entries in the `content` array of a single tool call. Each entry should have its own `startId`, `endId`, and `summary`.\n";
2
+ //# sourceMappingURL=compress-range.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress-range.d.ts","sourceRoot":"","sources":["../../../lib/prompts/compress-range.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,8tHA4D1B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const CONTEXT_LIMIT_NUDGE = "\n<system-reminder>\n\u26A0\uFE0F CRITICAL: Context limit reached. You MUST use the `compress` tool NOW.\n\nIf mid-atomic-operation, finish that step first, then compress immediately.\n\nHOW TO CALL COMPRESS:\n{\n \"topic\": \"Short Label\",\n \"content\": [\n {\n \"startId\": \"<ID from early in this conversation>\",\n \"endId\": \"<ID from later in this conversation>\",\n \"summary\": \"Complete technical summary of everything in the range\"\n }\n ]\n}\n\n\u26A0\uFE0F ID RULES \u2014 MOST COMMON CAUSE OF ERRORS:\n- ONLY use IDs you can see in <dcp-message-id> tags in the messages ABOVE.\n- Do NOT copy IDs from this example. Do NOT invent IDs.\n- Do NOT use IDs from compressed block summaries \u2014 they are stale.\n- startId must appear BEFORE endId in the conversation.\n\nSUMMARY RULES:\n- Capture ALL essential details: file paths, decisions, constraints, key findings.\n- Preserve user intent exactly. Direct-quote short user messages.\n- Prefer one large range over multiple small ones.\n- Compress OLDER resolved history first. Keep recent active work.\n</system-reminder>\n";
2
+ //# sourceMappingURL=context-limit-nudge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-limit-nudge.d.ts","sourceRoot":"","sources":["../../../lib/prompts/context-limit-nudge.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,imCA8B/B,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { SessionState } from "../../state";
2
+ import type { GCConfig } from "../../config";
3
+ export interface BlockGuidanceContext {
4
+ currentTokens?: number;
5
+ modelContextLimit?: number;
6
+ }
7
+ export declare function buildCompressedBlockGuidance(state: SessionState, gcConfig?: GCConfig, context?: BlockGuidanceContext): string;
8
+ export declare function renderMessagePriorityGuidance(priorityLabel: string, refs: string[]): string;
9
+ export declare function appendGuidanceToDcpTag(nudgeText: string, guidance: string): string;
10
+ //# sourceMappingURL=nudge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nudge.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/extensions/nudge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,WAAW,oBAAoB;IACjC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,wBAAgB,4BAA4B,CACxC,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE,oBAAoB,GAC/B,MAAM,CAuDR;AAED,wBAAgB,6BAA6B,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAQ3F;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAelF"}
@@ -0,0 +1,4 @@
1
+ export declare const MANUAL_MODE_SYSTEM_EXTENSION = "<dcp-system-reminder>\nManual mode is enabled. Do NOT use compress unless the user has explicitly triggered it through a manual marker.\n\nOnly use the compress tool after seeing `<compress triggered manually>` in the current user instruction context.\n\nIssue exactly ONE compress tool per manual trigger. Do NOT launch multiple compress tools in parallel. Each trigger grants a single compression; after it completes, wait for the next trigger.\n\nAfter completing a manually triggered context-management action, STOP IMMEDIATELY. Do NOT continue with any task execution. End your response right after the tool use completes and wait for the next user input.\n</dcp-system-reminder>\n";
2
+ export declare const SUBAGENT_SYSTEM_EXTENSION = "<dcp-system-reminder>\nYou are operating in a subagent environment.\n\nThe initial subagent instruction is imperative and must be followed exactly.\nIt is the only user message intentionally not assigned a message ID, and therefore is not eligible for compression.\nAll subsequent messages in the session will have IDs.\n</dcp-system-reminder>\n";
3
+ export declare function buildProtectedToolsExtension(protectedTools: string[]): string;
4
+ //# sourceMappingURL=system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/extensions/system.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,mrBASxC,CAAA;AAED,eAAO,MAAM,yBAAyB,8VAOrC,CAAA;AAED,wBAAgB,4BAA4B,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,CAW7E"}
@@ -0,0 +1,3 @@
1
+ export declare const RANGE_FORMAT_EXTENSION = "\nTHE FORMAT OF COMPRESS\n\n```\n{\n topic: string, // Short label (3-5 words) - e.g., \"Auth System Exploration\"\n content: [ // One or more ranges to compress\n {\n startId: string, // Boundary ID at range start: mNNNN or bN\n endId: string, // Boundary ID at range end: mNNNN or bN\n summary: string // Complete technical summary replacing all content in range\n }\n ]\n}\n```";
2
+ export declare const MESSAGE_FORMAT_EXTENSION = "\nTHE FORMAT OF COMPRESS\n\n```\n{\n topic: string, // Short label (3-5 words) for the overall batch\n content: [ // One or more messages to compress independently\n {\n messageId: string, // Raw message ID only: mNNNN (ignore metadata attributes like priority)\n topic: string, // Short label (3-5 words) for this one message summary\n summary: string // Complete technical summary replacing that one message\n }\n ]\n}\n```";
3
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/extensions/tool.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,gcAc5B,CAAA;AAEP,eAAO,MAAM,wBAAwB,2eAc9B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { RuntimePrompts } from "./store";
2
+ export type { PromptStore, RuntimePrompts } from "./store";
3
+ export declare function renderSystemPrompt(prompts: RuntimePrompts, protectedToolsExtension?: string, manual?: boolean, subagent?: boolean): string;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE1D,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,cAAc,EACvB,uBAAuB,CAAC,EAAE,MAAM,EAChC,MAAM,CAAC,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,OAAO,GACnB,MAAM,CAoBR"}
@@ -0,0 +1,2 @@
1
+ export declare const ITERATION_NUDGE = "\n<system-reminder>\nYou've been iterating for a while. If any earlier work is closed and unlikely to be referenced, compress it now.\n\n{\n \"topic\": \"Short Label\",\n \"content\": [{ \"startId\": \"<visible message ID>\", \"endId\": \"<visible message ID>\", \"summary\": \"...\" }]\n}\n\n\u26A0\uFE0F ONLY use IDs from <dcp-message-id> tags visible above. Do NOT invent or copy example IDs.\n</system-reminder>\n";
2
+ //# sourceMappingURL=iteration-nudge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iteration-nudge.d.ts","sourceRoot":"","sources":["../../../lib/prompts/iteration-nudge.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,waAW3B,CAAA"}
@@ -0,0 +1,25 @@
1
+ import type { Logger } from "../logger";
2
+ export type PromptKey = "system" | "compress-range" | "compress-message" | "context-limit-nudge" | "turn-nudge" | "iteration-nudge";
3
+ export interface RuntimePrompts {
4
+ system: string;
5
+ compressRange: string;
6
+ compressMessage: string;
7
+ contextLimitNudge: string;
8
+ turnNudge: string;
9
+ iterationNudge: string;
10
+ manualExtension: string;
11
+ subagentExtension: string;
12
+ }
13
+ export declare const PROMPT_KEYS: PromptKey[];
14
+ export declare class PromptStore {
15
+ private readonly logger;
16
+ private readonly paths;
17
+ private readonly customPromptsEnabled;
18
+ private runtimePrompts;
19
+ constructor(logger: Logger, workingDirectory: string, customPromptsEnabled?: boolean);
20
+ getRuntimePrompts(): RuntimePrompts;
21
+ reload(): void;
22
+ private getOverrideCandidates;
23
+ private ensureDefaultFiles;
24
+ }
25
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../lib/prompts/store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AASvC,MAAM,MAAM,SAAS,GACf,QAAQ,GACR,gBAAgB,GAChB,kBAAkB,GAClB,qBAAqB,GACrB,YAAY,GACZ,iBAAiB,CAAA;AA8BvB,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;CAC5B;AAqDD,eAAO,MAAM,WAAW,EAAE,SAAS,EAOlC,CAAA;AA8MD,qBAAa,WAAW;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,cAAc,CAAgB;gBAE1B,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,oBAAoB,UAAQ;IAYlF,iBAAiB,IAAI,cAAc;IAInC,MAAM,IAAI,IAAI;IAiDd,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,kBAAkB;CAkD7B"}
@@ -0,0 +1,2 @@
1
+ export declare const SYSTEM = "\nYou operate in a context-constrained environment. Manage context continuously to avoid buildup and preserve retrieval quality. Efficient context management is paramount for your agentic performance.\n\nThe ONLY tool you have for context management is `compress`. It replaces older conversation content with technical summaries you produce.\n\n`<dcp-message-id>` and `<dcp-system-reminder>` tags are environment-injected metadata. Do not output them.\n\nTHE PHILOSOPHY OF COMPRESS\n`compress` transforms conversation content into dense, high-fidelity summaries. This is not cleanup - it is crystallization. Your summary becomes the authoritative record of what transpired.\n\nThink of compression as phase transitions: raw exploration becomes refined understanding. The original context served its purpose; your summary now carries that understanding forward.\n\nCOMPRESS WHEN\n\nA section is genuinely closed and the raw conversation has served its purpose:\n\n- Research concluded and findings are clear\n- Implementation finished and verified\n- Exploration exhausted and patterns understood\n- Dead-end noise can be discarded without waiting for a whole chapter to close\n\nDO NOT COMPRESS IF\n\n- Raw context is still relevant and needed for edits or precise references\n- The target content is still actively in progress\n- You may need exact code, error messages, or file contents in the immediate next steps\n\nBefore compressing, ask: _\"Is this section closed enough to become summary-only right now?\"_\n\nEvaluate conversation signal-to-noise REGULARLY. Use `compress` deliberately with quality-first summaries. Prioritize stale content intelligently to maintain a high-signal context window that supports your agency.\n\nIt is of your responsibility to keep a sharp, high-quality context window for optimal performance.\n";
2
+ //# sourceMappingURL=system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../lib/prompts/system.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,gzDAgClB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const TURN_NUDGE = "\n<system-reminder>\nContext is getting full. Compress closed/older conversation ranges now.\n\n{\n \"topic\": \"Short Label\",\n \"content\": [{ \"startId\": \"<visible message ID>\", \"endId\": \"<visible message ID>\", \"summary\": \"...\" }]\n}\n\n\u26A0\uFE0F ONLY use IDs from <dcp-message-id> tags visible above. Do NOT invent or copy example IDs.\n</system-reminder>\n";
2
+ //# sourceMappingURL=turn-nudge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-nudge.d.ts","sourceRoot":"","sources":["../../../lib/prompts/turn-nudge.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,+XAWtB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare function matchesGlob(inputPath: string, pattern: string): boolean;
2
+ export declare function getFilePathsFromParameters(tool: string, parameters: unknown): string[];
3
+ export declare function isFilePathProtected(filePaths: string[], patterns: string[]): boolean;
4
+ export declare function isToolNameProtected(toolName: string, patterns: string[]): boolean;
5
+ //# sourceMappingURL=protected-patterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protected-patterns.d.ts","sourceRoot":"","sources":["../../lib/protected-patterns.ts"],"names":[],"mappings":"AAQA,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAiDvE;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,EAAE,CAsCtF;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAKpF;AAID,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAmBjF"}
@@ -0,0 +1,5 @@
1
+ export * from "./persistence";
2
+ export * from "./types";
3
+ export * from "./state";
4
+ export * from "./tool-cache";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * State persistence module for ACP plugin.
3
+ * Persists pruned tool IDs across sessions so they survive OpenCode restarts.
4
+ * Storage location: ~/.local/share/opencode/storage/plugin/acp/{sessionId}.json
5
+ */
6
+ import type { CompressionBlock, PrunedMessageEntry, SessionState, SessionStats } from "./types";
7
+ import type { Logger } from "../logger";
8
+ /** Prune state as stored on disk */
9
+ export interface PersistedPruneMessagesState {
10
+ byMessageId: Record<string, PrunedMessageEntry>;
11
+ blocksById: Record<string, CompressionBlock>;
12
+ activeBlockIds: number[];
13
+ activeByAnchorMessageId: Record<string, number>;
14
+ nextBlockId: number;
15
+ nextRunId: number;
16
+ }
17
+ export interface PersistedPrune {
18
+ tools?: Record<string, number>;
19
+ messages?: PersistedPruneMessagesState;
20
+ }
21
+ export interface PersistedNudges {
22
+ contextLimitAnchors: string[];
23
+ turnNudgeAnchors?: string[];
24
+ iterationNudgeAnchors?: string[];
25
+ }
26
+ export interface PersistedMessageIds {
27
+ byRawId: Record<string, string>;
28
+ byRef: Record<string, string>;
29
+ nextRef: number;
30
+ }
31
+ export interface PersistedSessionState {
32
+ sessionName?: string;
33
+ prune: PersistedPrune;
34
+ nudges: PersistedNudges;
35
+ stats: SessionStats;
36
+ lastUpdated: string;
37
+ messageIds?: PersistedMessageIds;
38
+ lastCompaction?: number;
39
+ }
40
+ export declare function saveSessionState(sessionState: SessionState, logger: Logger, sessionName?: string): Promise<void>;
41
+ export declare function loadSessionState(sessionId: string, logger: Logger): Promise<PersistedSessionState | null>;
42
+ export interface AggregatedStats {
43
+ totalTokens: number;
44
+ totalTools: number;
45
+ totalMessages: number;
46
+ sessionCount: number;
47
+ }
48
+ export declare function loadAllSessionStats(logger: Logger): Promise<AggregatedStats>;
49
+ //# sourceMappingURL=persistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../../lib/state/persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAWvC,oCAAoC;AACpC,MAAM,WAAW,2BAA2B;IACxC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IAC/C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAC5C,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/C,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,QAAQ,CAAC,EAAE,2BAA2B,CAAA;CACzC;AAED,MAAM,WAAW,eAAe;IAC5B,mBAAmB,EAAE,MAAM,EAAE,CAAA;IAC7B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;CACnC;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,cAAc,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B;AAmDD,wBAAsB,gBAAgB,CAClC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED,wBAAsB,gBAAgB,CAClC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAiGvC;AAED,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;CACvB;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA2ClF"}
@@ -0,0 +1,7 @@
1
+ import type { SessionState, WithParts } from "./types";
2
+ import type { Logger } from "../logger";
3
+ export declare const checkSession: (client: any, state: SessionState, logger: Logger, messages: WithParts[], manualModeDefault: boolean) => Promise<void>;
4
+ export declare function createSessionState(): SessionState;
5
+ export declare function resetSessionState(state: SessionState): void;
6
+ export declare function ensureSessionInitialized(client: any, state: SessionState, sessionId: string, logger: Logger, messages: WithParts[], manualModeEnabled: boolean): Promise<void>;
7
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../lib/state/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAsB,SAAS,EAAE,MAAM,SAAS,CAAA;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAevC,eAAO,MAAM,YAAY,GACrB,QAAQ,GAAG,EACX,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,EACrB,mBAAmB,OAAO,KAC3B,OAAO,CAAC,IAAI,CAwCd,CAAA;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CAqCjD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CA+B3D;AAED,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,EACrB,iBAAiB,EAAE,OAAO,GAC3B,OAAO,CAAC,IAAI,CAAC,CAiEf"}
@@ -0,0 +1,13 @@
1
+ import type { SessionState, WithParts } from "./index";
2
+ import type { Logger } from "../logger";
3
+ import { PluginConfig } from "../config";
4
+ /**
5
+ * Sync tool parameters from session messages.
6
+ */
7
+ export declare function syncToolCache(state: SessionState, config: PluginConfig, logger: Logger, messages: WithParts[]): void;
8
+ /**
9
+ * Trim the tool parameters cache to prevent unbounded memory growth.
10
+ * Uses FIFO eviction - removes oldest entries first.
11
+ */
12
+ export declare function trimToolParametersCache(state: SessionState): void;
13
+ //# sourceMappingURL=tool-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-cache.d.ts","sourceRoot":"","sources":["../../../lib/state/tool-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAc,SAAS,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAMxC;;GAEG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,GACtB,IAAI,CAmEN;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAajE"}