metainsight-context-engine 0.0.8 → 0.0.10

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.
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "datasetName": {
38
38
  "type": "string",
39
- "default": "openclaw-metainsight-doc",
39
+ "default": "",
40
40
  "description": "CI dataset name for document search (auto-created if not exists)"
41
41
  },
42
42
  "templateId": {
@@ -130,7 +130,7 @@
130
130
  },
131
131
  "datasetName": {
132
132
  "label": "CI Dataset Name",
133
- "placeholder": "openclaw-metainsight-doc",
133
+ "placeholder": "",
134
134
  "help": "Auto-created with the selected template if it doesn't exist"
135
135
  },
136
136
  "templateId": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metainsight-context-engine",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Cloud-based context engine for token-efficient memory management (backed by Tencent COS CI)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -13,6 +13,8 @@
13
13
  },
14
14
  "files": [
15
15
  "dist",
16
+ "*.ts",
17
+ "types",
16
18
  "openclaw.plugin.json",
17
19
  "README.md"
18
20
  ],
@@ -58,7 +60,7 @@
58
60
  },
59
61
  "openclaw": {
60
62
  "extensions": [
61
- "./index.ts"
63
+ "./dist/index.js"
62
64
  ]
63
65
  }
64
66
  }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Minimal type stubs for openclaw/plugin-sdk/core
3
+ * (peer dependency — full types come from the actual package at runtime)
4
+ */
5
+
6
+ export interface ContextEngineInfo {
7
+ id: string;
8
+ name: string;
9
+ version: string;
10
+ ownsCompaction?: boolean;
11
+ }
12
+
13
+ export interface BootstrapResult {
14
+ bootstrapped: boolean;
15
+ }
16
+
17
+ export interface IngestResult {
18
+ ingested: boolean;
19
+ }
20
+
21
+ export interface IngestBatchResult {
22
+ ingestedCount: number;
23
+ }
24
+
25
+ export interface AssembleResult {
26
+ messages: unknown[];
27
+ estimatedTokens: number;
28
+ }
29
+
30
+ export interface CompactResult {
31
+ ok: boolean;
32
+ compacted: boolean;
33
+ reason?: string;
34
+ result?: {
35
+ tokensBefore: number;
36
+ tokensAfter: number;
37
+ };
38
+ }
39
+
40
+ export interface ContextEngineRuntimeContext {
41
+ [key: string]: unknown;
42
+ }
43
+
44
+ export interface ContextEngine {
45
+ info: ContextEngineInfo;
46
+ bootstrap(params: {
47
+ sessionId: string;
48
+ sessionKey?: string;
49
+ sessionFile: string;
50
+ }): Promise<BootstrapResult>;
51
+ ingest(params: {
52
+ sessionId: string;
53
+ sessionKey?: string;
54
+ message: unknown;
55
+ isHeartbeat?: boolean;
56
+ }): Promise<IngestResult>;
57
+ ingestBatch(params: {
58
+ sessionId: string;
59
+ sessionKey?: string;
60
+ messages: unknown[];
61
+ isHeartbeat?: boolean;
62
+ }): Promise<IngestBatchResult>;
63
+ assemble(params: {
64
+ sessionId: string;
65
+ sessionKey?: string;
66
+ messages: unknown[];
67
+ tokenBudget?: number;
68
+ }): Promise<AssembleResult>;
69
+ compact(params: {
70
+ sessionId: string;
71
+ sessionKey?: string;
72
+ sessionFile: string;
73
+ tokenBudget?: number;
74
+ force?: boolean;
75
+ currentTokenCount?: number;
76
+ compactionTarget?: 'budget' | 'threshold';
77
+ customInstructions?: string;
78
+ runtimeContext?: ContextEngineRuntimeContext;
79
+ }): Promise<CompactResult>;
80
+ afterTurn?(params: {
81
+ sessionId: string;
82
+ sessionKey?: string;
83
+ sessionFile: string;
84
+ messages: unknown[];
85
+ prePromptMessageCount: number;
86
+ autoCompactionSummary?: string;
87
+ isHeartbeat?: boolean;
88
+ tokenBudget?: number;
89
+ runtimeContext?: ContextEngineRuntimeContext;
90
+ }): Promise<void>;
91
+ dispose?(): Promise<void>;
92
+ }
93
+
94
+ export interface OpenClawPluginApi {
95
+ pluginConfig?: unknown;
96
+ logger: {
97
+ info: (...args: unknown[]) => void;
98
+ warn: (...args: unknown[]) => void;
99
+ };
100
+ registerContextEngine(id: string, factory: () => ContextEngine): void;
101
+ registerTool(definition: unknown, options?: unknown): void;
102
+ on(event: string, handler: (...args: any[]) => any, options?: unknown): void;
103
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Minimal type stubs for @mariozechner/pi-agent-core
3
+ * (peer dependency — full types come from the actual package at runtime)
4
+ */
5
+
6
+ export interface AgentMessage {
7
+ role: string;
8
+ content?: string;
9
+ [key: string]: unknown;
10
+ }