@serkanalgur/opencode-slim 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.
- package/LICENSE +21 -0
- package/README.md +101 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13876 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/compress.d.ts +28 -0
- package/dist/lib/compress.d.ts.map +1 -0
- package/dist/lib/config.d.ts +5 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/prompts.d.ts +4 -0
- package/dist/lib/prompts.d.ts.map +1 -0
- package/dist/lib/state.d.ts +8 -0
- package/dist/lib/state.d.ts.map +1 -0
- package/dist/lib/strategies.d.ts +12 -0
- package/dist/lib/strategies.d.ts.map +1 -0
- package/dist/lib/types.d.ts +90 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Part, ToolPart } from "@opencode-ai/sdk";
|
|
2
|
+
import type { MessageWithParts, CostProfile } from "./types";
|
|
3
|
+
export declare function countTokens(text: string): Promise<number>;
|
|
4
|
+
export declare function isToolPart(part: Part): part is ToolPart;
|
|
5
|
+
export declare function getToolParts(message: MessageWithParts): ToolPart[];
|
|
6
|
+
export declare function getToolName(message: MessageWithParts): string | null;
|
|
7
|
+
export declare function getToolArgs(message: MessageWithParts): unknown | null;
|
|
8
|
+
export declare function getToolResultContent(message: MessageWithParts): string;
|
|
9
|
+
export declare function getToolError(message: MessageWithParts): string | null;
|
|
10
|
+
export declare function getMessageText(message: MessageWithParts): string;
|
|
11
|
+
interface SemanticGroup {
|
|
12
|
+
topic: string;
|
|
13
|
+
messages: MessageWithParts[];
|
|
14
|
+
score: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function groupMessagesByTopic(messages: MessageWithParts[]): SemanticGroup[];
|
|
17
|
+
export declare function calculateCompressionRatio(inputTokens: number, outputTokens: number): number;
|
|
18
|
+
export declare function shouldCompress(currentTokens: number, maxTokens: number, minTokens: number, lastCompressionTime: number, nudgeFrequency: number, messageCount: number): {
|
|
19
|
+
compress: boolean;
|
|
20
|
+
reason: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function calculateCost(inputTokens: number, outputTokens: number, cacheReadTokens: number, profile: CostProfile): number;
|
|
23
|
+
export declare function estimateSavings(messages: MessageWithParts[], profile: CostProfile): {
|
|
24
|
+
tokensSaved: number;
|
|
25
|
+
costSaved: number;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=compress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compress.d.ts","sourceRoot":"","sources":["../../lib/compress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAa,MAAM,kBAAkB,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAkB5D,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO/D;AAID,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,QAAQ,CAEvD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAElE;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAOpE;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,GAAG,IAAI,CAarE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAOtE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAOrE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAQhE;AAID,UAAU,aAAa;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,gBAAgB,EAAE,CAAA;IAC5B,KAAK,EAAE,MAAM,CAAA;CAChB;AAkCD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,aAAa,EAAE,CA6BlF;AAID,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAG3F;AAED,wBAAgB,cAAc,CAC1B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,MAAM,EAC3B,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,GACrB;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAevC;AAID,wBAAgB,aAAa,CACzB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,WAAW,GACrB,MAAM,CAKR;AAED,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,OAAO,EAAE,WAAW,GACrB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAS5C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SlimConfig } from "./types";
|
|
2
|
+
export declare function loadConfig(): SlimConfig;
|
|
3
|
+
export declare function createDefaultConfig(): void;
|
|
4
|
+
export declare function resolveTokenLimit(value: number | string, contextLimit: number): number;
|
|
5
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAgGzC,wBAAgB,UAAU,IAAI,UAAU,CAmBvC;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAa1C;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAMtF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function getSystemPrompt(isCompact?: boolean): string;
|
|
2
|
+
export declare function getCompressToolDescription(): string;
|
|
3
|
+
export declare function getNudgeMessage(reason: string, tokenCount: number, maxTokens: number): string;
|
|
4
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../lib/prompts.ts"],"names":[],"mappings":"AAiCA,wBAAgB,eAAe,CAAC,SAAS,GAAE,OAAe,GAAG,MAAM,CAElE;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAcnD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAa7F"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SessionState, CompressionRecord } from "./types";
|
|
2
|
+
export declare function loadSessionState(sessionId: string, persistenceDir: string): SessionState;
|
|
3
|
+
export declare function saveSessionState(state: SessionState, persistenceDir: string): void;
|
|
4
|
+
export declare function addCompressionRecord(state: SessionState, record: CompressionRecord, learningRate: number): void;
|
|
5
|
+
export declare function trackToolCall(state: SessionState, tool: string, args: unknown, turn: number, error?: string): void;
|
|
6
|
+
export declare function getDuplicateToolCalls(state: SessionState): string[];
|
|
7
|
+
export declare function getErroredToolCalls(state: SessionState, currentTurn: number, turnsThreshold: number): string[];
|
|
8
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../lib/state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAgB,MAAM,SAAS,CAAA;AAmB5E,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,YAAY,CAiBxF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAalF;AAED,wBAAgB,oBAAoB,CAChC,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,iBAAiB,EACzB,YAAY,EAAE,MAAM,GACrB,IAAI,CAcN;AAED,wBAAgB,aAAa,CACzB,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,GACf,IAAI,CASN;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAmBnE;AAED,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACvB,MAAM,EAAE,CAUV"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MessageWithParts, SlimConfig } from "./types";
|
|
2
|
+
export declare function findDuplicateToolCalls(messages: MessageWithParts[], protectedTools: string[]): number[];
|
|
3
|
+
export declare function findErroredToolCalls(messages: MessageWithParts[], currentTurn: number, turnsThreshold: number, protectedTools: string[]): number[];
|
|
4
|
+
export declare function pruneMessages(messages: MessageWithParts[], config: SlimConfig, currentTurn: number): MessageWithParts[];
|
|
5
|
+
export interface CompressionTarget {
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
reason: string;
|
|
9
|
+
estimatedTokens: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function selectCompressionTargets(messages: MessageWithParts[], minTokens: number, protectedTools: string[]): CompressionTarget[];
|
|
12
|
+
//# sourceMappingURL=strategies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategies.d.ts","sourceRoot":"","sources":["../../lib/strategies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAU3D,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,cAAc,EAAE,MAAM,EAAE,GACzB,MAAM,EAAE,CA8BV;AAID,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,EAAE,GACzB,MAAM,EAAE,CAwBV;AAID,wBAAgB,aAAa,CACzB,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,MAAM,GACpB,gBAAgB,EAAE,CA4BpB;AAID,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EAAE,GACzB,iBAAiB,EAAE,CA4CrB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Message, Part } from "@opencode-ai/sdk";
|
|
2
|
+
export interface SlimConfig {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
debug: boolean;
|
|
5
|
+
compress: {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
permission: "allow" | "ask" | "deny";
|
|
8
|
+
maxContextLimit: number | string;
|
|
9
|
+
minContextLimit: number | string;
|
|
10
|
+
nudgeFrequency: number;
|
|
11
|
+
protectUserMessages: boolean;
|
|
12
|
+
protectedTools: string[];
|
|
13
|
+
};
|
|
14
|
+
strategies: {
|
|
15
|
+
deduplication: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
protectedTools: string[];
|
|
18
|
+
};
|
|
19
|
+
purgeErrors: {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
turns: number;
|
|
22
|
+
protectedTools: string[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
adaptive: {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
learningRate: number;
|
|
28
|
+
minCompressionRatio: number;
|
|
29
|
+
};
|
|
30
|
+
costAware: {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
cacheBoostFactor: number;
|
|
33
|
+
};
|
|
34
|
+
persistence: {
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
directory: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface SessionState {
|
|
40
|
+
sessionId: string;
|
|
41
|
+
modelContextLimit: number;
|
|
42
|
+
currentTokenCount: number;
|
|
43
|
+
compressionCount: number;
|
|
44
|
+
lastCompressionTime: number;
|
|
45
|
+
manualMode: boolean;
|
|
46
|
+
compressPermission: "allow" | "ask" | "deny" | null;
|
|
47
|
+
compressionHistory: CompressionRecord[];
|
|
48
|
+
averageCompressionRatio: number;
|
|
49
|
+
toolCalls: Map<string, ToolCallInfo>;
|
|
50
|
+
}
|
|
51
|
+
export interface CompressionRecord {
|
|
52
|
+
timestamp: number;
|
|
53
|
+
inputTokens: number;
|
|
54
|
+
outputTokens: number;
|
|
55
|
+
ratio: number;
|
|
56
|
+
messageCount: number;
|
|
57
|
+
success: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface ToolCallInfo {
|
|
60
|
+
tool: string;
|
|
61
|
+
args: unknown;
|
|
62
|
+
timestamp: number;
|
|
63
|
+
turn: number;
|
|
64
|
+
error?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface MessageWithParts {
|
|
67
|
+
info: Message;
|
|
68
|
+
parts: Part[];
|
|
69
|
+
}
|
|
70
|
+
export interface CompressionRange {
|
|
71
|
+
start: number;
|
|
72
|
+
end: number;
|
|
73
|
+
messages: MessageWithParts[];
|
|
74
|
+
}
|
|
75
|
+
export interface CompressionResult {
|
|
76
|
+
success: boolean;
|
|
77
|
+
summary: string;
|
|
78
|
+
inputTokens: number;
|
|
79
|
+
outputTokens: number;
|
|
80
|
+
ratio: number;
|
|
81
|
+
compressedIds: string[];
|
|
82
|
+
}
|
|
83
|
+
export interface CostProfile {
|
|
84
|
+
inputPricePer1k: number;
|
|
85
|
+
outputPricePer1k: number;
|
|
86
|
+
cacheReadPricePer1k: number;
|
|
87
|
+
cacheWritePricePer1k: number;
|
|
88
|
+
}
|
|
89
|
+
export declare const COST_PROFILES: Record<string, CostProfile>;
|
|
90
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAuB,MAAM,kBAAkB,CAAA;AAI1E,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IAGd,QAAQ,EAAE;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,UAAU,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;QACpC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAA;QAChC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAA;QAChC,cAAc,EAAE,MAAM,CAAA;QACtB,mBAAmB,EAAE,OAAO,CAAA;QAC5B,cAAc,EAAE,MAAM,EAAE,CAAA;KAC3B,CAAA;IAGD,UAAU,EAAE;QACR,aAAa,EAAE;YACX,OAAO,EAAE,OAAO,CAAA;YAChB,cAAc,EAAE,MAAM,EAAE,CAAA;SAC3B,CAAA;QACD,WAAW,EAAE;YACT,OAAO,EAAE,OAAO,CAAA;YAChB,KAAK,EAAE,MAAM,CAAA;YACb,cAAc,EAAE,MAAM,EAAE,CAAA;SAC3B,CAAA;KACJ,CAAA;IAGD,QAAQ,EAAE;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;QACpB,mBAAmB,EAAE,MAAM,CAAA;KAC9B,CAAA;IAGD,SAAS,EAAE;QACP,OAAO,EAAE,OAAO,CAAA;QAChB,gBAAgB,EAAE,MAAM,CAAA;KAC3B,CAAA;IAGD,WAAW,EAAE;QACT,OAAO,EAAE,OAAO,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;KACpB,CAAA;CACJ;AAID,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,UAAU,EAAE,OAAO,CAAA;IACnB,kBAAkB,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAAA;IAGnD,kBAAkB,EAAE,iBAAiB,EAAE,CAAA;IACvC,uBAAuB,EAAE,MAAM,CAAA;IAG/B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CACvC;AAED,MAAM,WAAW,iBAAiB;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAID,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,IAAI,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,EAAE,CAAA;CAC1B;AAID,MAAM,WAAW,WAAW;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,oBAAoB,EAAE,MAAM,CAAA;CAC/B;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAkCrD,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@serkanalgur/opencode-slim",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Smart context management plugin for OpenCode - semantic compression, cost-aware pruning, adaptive thresholds",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"opencode",
|
|
7
|
+
"opencode-plugin",
|
|
8
|
+
"context",
|
|
9
|
+
"compression",
|
|
10
|
+
"pruning",
|
|
11
|
+
"tokens",
|
|
12
|
+
"semantic"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/serkanalgur/opencode-slim#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/serkanalgur/opencode-slim/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/serkanalgur/opencode-slim.git"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "serkanalgur",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"directories": {
|
|
34
|
+
"lib": "lib",
|
|
35
|
+
"test": "tests"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist/",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"clean": "rm -rf dist",
|
|
44
|
+
"build": "npm run clean && tsup && tsc --emitDeclarationOnly",
|
|
45
|
+
"dev": "tsup --watch",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "node --import tsx --test tests/*.test.ts",
|
|
48
|
+
"format": "prettier --write .",
|
|
49
|
+
"format:check": "prettier --check ."
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@anthropic-ai/tokenizer": "^0.0.4",
|
|
53
|
+
"jsonc-parser": "^3.3.1"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@opencode-ai/plugin": "^1.18.29",
|
|
57
|
+
"@types/node": "^22.0.0",
|
|
58
|
+
"prettier": "^3.4.0",
|
|
59
|
+
"tsup": "^8.3.0",
|
|
60
|
+
"tsx": "^4.19.0",
|
|
61
|
+
"typescript": "^5.7.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@opencode-ai/plugin": ">=1.18.29"
|
|
65
|
+
},
|
|
66
|
+
"$schema": "https://json.schemastore.org/package.json"
|
|
67
|
+
}
|