super-memory-pro 0.2.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/README.md +247 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +25 -0
- package/dist/config.js.map +1 -0
- package/dist/db/connection.d.ts +20 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +66 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/migrations/001_initial.sql +102 -0
- package/dist/db/migrations.d.ts +14 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +86 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +24 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +179 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/hooks/event-handler.d.ts +13 -0
- package/dist/hooks/event-handler.d.ts.map +1 -0
- package/dist/hooks/event-handler.js +80 -0
- package/dist/hooks/event-handler.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/message-handler.d.ts +13 -0
- package/dist/hooks/message-handler.d.ts.map +1 -0
- package/dist/hooks/message-handler.js +47 -0
- package/dist/hooks/message-handler.js.map +1 -0
- package/dist/hooks/session-compactor.d.ts +15 -0
- package/dist/hooks/session-compactor.d.ts.map +1 -0
- package/dist/hooks/session-compactor.js +40 -0
- package/dist/hooks/session-compactor.js.map +1 -0
- package/dist/hooks/system-transform.d.ts +27 -0
- package/dist/hooks/system-transform.d.ts.map +1 -0
- package/dist/hooks/system-transform.js +76 -0
- package/dist/hooks/system-transform.js.map +1 -0
- package/dist/hooks/tool-handler.d.ts +14 -0
- package/dist/hooks/tool-handler.d.ts.map +1 -0
- package/dist/hooks/tool-handler.js +94 -0
- package/dist/hooks/tool-handler.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +152 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/index.d.ts +19 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +553 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/memory/extractor.d.ts +29 -0
- package/dist/memory/extractor.d.ts.map +1 -0
- package/dist/memory/extractor.js +426 -0
- package/dist/memory/extractor.js.map +1 -0
- package/dist/memory/index.d.ts +7 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +7 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/processor.d.ts +50 -0
- package/dist/memory/processor.d.ts.map +1 -0
- package/dist/memory/processor.js +199 -0
- package/dist/memory/processor.js.map +1 -0
- package/dist/memory/search.d.ts +35 -0
- package/dist/memory/search.d.ts.map +1 -0
- package/dist/memory/search.js +170 -0
- package/dist/memory/search.js.map +1 -0
- package/dist/memory/store.d.ts +32 -0
- package/dist/memory/store.d.ts.map +1 -0
- package/dist/memory/store.js +112 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +49 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/middleware/async-handler.d.ts +11 -0
- package/dist/server/middleware/async-handler.d.ts.map +1 -0
- package/dist/server/middleware/async-handler.js +14 -0
- package/dist/server/middleware/async-handler.js.map +1 -0
- package/dist/server/middleware/error-handler.d.ts +11 -0
- package/dist/server/middleware/error-handler.d.ts.map +1 -0
- package/dist/server/middleware/error-handler.js +18 -0
- package/dist/server/middleware/error-handler.js.map +1 -0
- package/dist/server/routes/health.d.ts +2 -0
- package/dist/server/routes/health.d.ts.map +1 -0
- package/dist/server/routes/health.js +25 -0
- package/dist/server/routes/health.js.map +1 -0
- package/dist/server/routes/memory.d.ts +2 -0
- package/dist/server/routes/memory.d.ts.map +1 -0
- package/dist/server/routes/memory.js +139 -0
- package/dist/server/routes/memory.js.map +1 -0
- package/dist/server/schemas.d.ts +51 -0
- package/dist/server/schemas.d.ts.map +1 -0
- package/dist/server/schemas.js +23 -0
- package/dist/server/schemas.js.map +1 -0
- package/dist/tools/definitions.d.ts +130 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +78 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/index.d.ts +32 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +148 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types.d.ts +108 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// ─── Tool Handler ────────────────────────────────────────────────────────────
|
|
2
|
+
// Handles the `tool.execute.after` hook — captures successful tool outputs
|
|
3
|
+
// as pattern memories. Fire-and-forget to never block.
|
|
4
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
import { storeMemory } from '../memory/store.js';
|
|
6
|
+
/**
|
|
7
|
+
* Create a handler for the `tool.execute.after` hook.
|
|
8
|
+
*
|
|
9
|
+
* When a tool executes successfully, the handler extracts meaningful
|
|
10
|
+
* patterns from the tool output and stores them as `pattern`-type
|
|
11
|
+
* memories. This enables the memory system to learn from tool usage
|
|
12
|
+
* over time.
|
|
13
|
+
*
|
|
14
|
+
* The handler is fire-and-forget — it returns immediately without awaiting
|
|
15
|
+
* any memory operations.
|
|
16
|
+
*/
|
|
17
|
+
export function createToolAfterHandler() {
|
|
18
|
+
return async (input, output) => {
|
|
19
|
+
// Fire-and-forget: kick off async work without awaiting
|
|
20
|
+
const run = async () => {
|
|
21
|
+
try {
|
|
22
|
+
const { tool, sessionID, args } = input;
|
|
23
|
+
const { output: toolOutput, title } = output;
|
|
24
|
+
// Skip if no meaningful output to learn from
|
|
25
|
+
if (!toolOutput || toolOutput.trim().length === 0)
|
|
26
|
+
return;
|
|
27
|
+
// Generate a concise pattern description from the tool result
|
|
28
|
+
const toolSummary = title && title !== toolOutput
|
|
29
|
+
? `Tool ${tool} completed: ${title}`
|
|
30
|
+
: `Tool ${tool} executed successfully`;
|
|
31
|
+
// Store the tool invocation as a pattern memory for future recall
|
|
32
|
+
await storeMemory({
|
|
33
|
+
memory_type: 'pattern',
|
|
34
|
+
session_id: sessionID,
|
|
35
|
+
key: `tool:${tool}:${createContentHash(toolOutput)}`,
|
|
36
|
+
content: toolOutput.length > 500
|
|
37
|
+
? `${toolSummary}\n\n${toolOutput.slice(0, 500)}...`
|
|
38
|
+
: `${toolSummary}\n\n${toolOutput}`,
|
|
39
|
+
importance: 2,
|
|
40
|
+
source: 'tool',
|
|
41
|
+
metadata: {
|
|
42
|
+
tool,
|
|
43
|
+
title,
|
|
44
|
+
args: sanitizeArgs(args),
|
|
45
|
+
extracted: true,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
console.error('[UltraMemory] tool-handler error:', err);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
// Kick off but don't await — fire-and-forget
|
|
54
|
+
void run();
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
58
|
+
/**
|
|
59
|
+
* Create a stable content hash for deduplication keys.
|
|
60
|
+
* Uses djb2 — not cryptographic, just stable for key generation.
|
|
61
|
+
*/
|
|
62
|
+
function createContentHash(content) {
|
|
63
|
+
let hash = 5381;
|
|
64
|
+
const normalized = content.toLowerCase().trim();
|
|
65
|
+
for (let i = 0; i < normalized.length; i++) {
|
|
66
|
+
hash = ((hash << 5) + hash + normalized.charCodeAt(i)) & 0xffffffff;
|
|
67
|
+
}
|
|
68
|
+
return Math.abs(hash).toString(36);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Sanitize arguments for safe metadata storage.
|
|
72
|
+
* Strips potential sensitive values while preserving structure.
|
|
73
|
+
*/
|
|
74
|
+
function sanitizeArgs(args) {
|
|
75
|
+
if (!args)
|
|
76
|
+
return {};
|
|
77
|
+
const sanitized = {};
|
|
78
|
+
for (const [key, value] of Object.entries(args)) {
|
|
79
|
+
// Skip potentially sensitive keys
|
|
80
|
+
if (/^(?:password|token|secret|key|api[_-]?key|auth|credential)$/i.test(key)) {
|
|
81
|
+
sanitized[key] = '[REDACTED]';
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
// Keep string values under 200 chars, otherwise truncate
|
|
85
|
+
if (typeof value === 'string' && value.length > 200) {
|
|
86
|
+
sanitized[key] = `${value.slice(0, 200)}...`;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
sanitized[key] = value;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return sanitized;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=tool-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-handler.js","sourceRoot":"","sources":["../../src/hooks/tool-handler.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,2EAA2E;AAC3E,uDAAuD;AACvD,iFAAiF;AAGjF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC7B,wDAAwD;QACxD,MAAM,GAAG,GAAG,KAAK,IAAmB,EAAE;YACpC,IAAI,CAAC;gBACH,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;gBACxC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;gBAE7C,6CAA6C;gBAC7C,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;oBAAE,OAAO;g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AAC,CAAC,GAAG,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;IACtE,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CACnB,IAAyC;IAEzC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,SAAS,GAA4B,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,kCAAkC;QAClC,IACE,8DAA8D,CAAC,IAAI,CAAC,GAAG,CAAC,EACxE,CAAC;YACD,SAAS,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;YAC9B,SAAS;QACX,CAAC;QACD,yDAAyD;QACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACpD,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAA8B,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA6BpF,QAAA,MAAM,YAAY,EAAE,YAsJnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// ─── Ultra Memory Plugin Entry Point ───────────────────────────────────────
|
|
2
|
+
// Default export: PluginModule (server function returning Hooks).
|
|
3
|
+
// OpenCode calls this when loading the plugin.
|
|
4
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
import { tool } from '@opencode-ai/plugin';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { loadConfig } from './config.js';
|
|
8
|
+
import { getPool, closePool } from './db/connection.js';
|
|
9
|
+
import { runMigrations } from './db/migrations.js';
|
|
10
|
+
import { createServer } from './server/index.js';
|
|
11
|
+
import { createMessageHandler } from './hooks/message-handler.js';
|
|
12
|
+
import { createEventHandler } from './hooks/event-handler.js';
|
|
13
|
+
import { createToolAfterHandler } from './hooks/tool-handler.js';
|
|
14
|
+
import { createSystemTransform } from './hooks/system-transform.js';
|
|
15
|
+
import { createSessionCompactor } from './hooks/session-compactor.js';
|
|
16
|
+
import { executeMemSave, executeMemSearch, executeMemForget, executeMemStats, } from './tools/index.js';
|
|
17
|
+
// ─── Module-level state ────────────────────────────────────────────────────
|
|
18
|
+
// Kept outside the server function so dispose() can access the same handle.
|
|
19
|
+
let serverHandle = null;
|
|
20
|
+
// ─── Plugin Module ─────────────────────────────────────────────────────────
|
|
21
|
+
// OpenCode loads a plugin by importing its module and reading the default
|
|
22
|
+
// export. The `server` property is an async factory that receives the
|
|
23
|
+
// OpenCode client and returns a Hooks object.
|
|
24
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
25
|
+
const pluginModule = {
|
|
26
|
+
id: 'super-memory',
|
|
27
|
+
server: async (_input, _options) => {
|
|
28
|
+
const config = loadConfig();
|
|
29
|
+
// ── Initialise database ───────────────────────────────────────────────
|
|
30
|
+
try {
|
|
31
|
+
const pool = getPool(config);
|
|
32
|
+
const applied = await runMigrations(pool);
|
|
33
|
+
if (applied.length > 0) {
|
|
34
|
+
console.log(`[UltraMemory] Applied ${applied.length} pending migration(s)`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
console.error('[UltraMemory] DB init failed — plugin will run with degraded functionality:', err instanceof Error ? err.message : String(err));
|
|
39
|
+
}
|
|
40
|
+
// ── Start Express server ──────────────────────────────────────────────
|
|
41
|
+
try {
|
|
42
|
+
serverHandle = await createServer(config);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
console.error('[UltraMemory] Failed to start memory server:', err instanceof Error ? err.message : String(err));
|
|
46
|
+
}
|
|
47
|
+
// ── Return hooks ──────────────────────────────────────────────────────
|
|
48
|
+
return {
|
|
49
|
+
// Cleanup on plugin unload
|
|
50
|
+
dispose: async () => {
|
|
51
|
+
if (serverHandle) {
|
|
52
|
+
try {
|
|
53
|
+
await serverHandle.close();
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
console.error('[UltraMemory] Error closing server:', err);
|
|
57
|
+
}
|
|
58
|
+
serverHandle = null;
|
|
59
|
+
}
|
|
60
|
+
await closePool();
|
|
61
|
+
},
|
|
62
|
+
// Chat message hook — auto-extracts memories from messages
|
|
63
|
+
'chat.message': createMessageHandler(),
|
|
64
|
+
// Event hook — tracks session lifecycle and message completion
|
|
65
|
+
event: createEventHandler(),
|
|
66
|
+
// Tool after-execution hook — captures patterns from tool output
|
|
67
|
+
'tool.execute.after': createToolAfterHandler(),
|
|
68
|
+
// System prompt transform — injects relevant memories into LLM context
|
|
69
|
+
'experimental.chat.system.transform': createSystemTransform(config),
|
|
70
|
+
// Session compactor — hints the compactor to preserve memory-related info
|
|
71
|
+
'experimental.session.compacting': createSessionCompactor(),
|
|
72
|
+
// Custom tools — registered so OpenCode exposes them to the LLM
|
|
73
|
+
tool: {
|
|
74
|
+
mem_save: tool({
|
|
75
|
+
description: 'Save a piece of information to Ultra Memory for future recall across sessions',
|
|
76
|
+
args: {
|
|
77
|
+
key: z
|
|
78
|
+
.string()
|
|
79
|
+
.describe('Unique key for this memory (e.g. "favorite-framework")'),
|
|
80
|
+
content: z.string().describe('The memory content to store'),
|
|
81
|
+
type: z
|
|
82
|
+
.enum([
|
|
83
|
+
'user_profile',
|
|
84
|
+
'tech_stack',
|
|
85
|
+
'project_context',
|
|
86
|
+
'pattern',
|
|
87
|
+
'decision',
|
|
88
|
+
'explicit',
|
|
89
|
+
])
|
|
90
|
+
.optional()
|
|
91
|
+
.default('explicit')
|
|
92
|
+
.describe('Optional memory category'),
|
|
93
|
+
importance: z
|
|
94
|
+
.number()
|
|
95
|
+
.min(1)
|
|
96
|
+
.max(5)
|
|
97
|
+
.optional()
|
|
98
|
+
.default(3)
|
|
99
|
+
.describe('Importance level 1-5 (higher = more likely recalled)'),
|
|
100
|
+
},
|
|
101
|
+
execute: executeMemSave,
|
|
102
|
+
}),
|
|
103
|
+
mem_search: tool({
|
|
104
|
+
description: 'Search through all stored Ultra Memory entries across sessions',
|
|
105
|
+
args: {
|
|
106
|
+
query: z
|
|
107
|
+
.string()
|
|
108
|
+
.describe('Search text to find relevant memories'),
|
|
109
|
+
type: z
|
|
110
|
+
.enum([
|
|
111
|
+
'user_profile',
|
|
112
|
+
'tech_stack',
|
|
113
|
+
'project_context',
|
|
114
|
+
'session',
|
|
115
|
+
'pattern',
|
|
116
|
+
'decision',
|
|
117
|
+
'explicit',
|
|
118
|
+
])
|
|
119
|
+
.optional()
|
|
120
|
+
.describe('Optional filter by memory type'),
|
|
121
|
+
limit: z
|
|
122
|
+
.number()
|
|
123
|
+
.int()
|
|
124
|
+
.min(1)
|
|
125
|
+
.max(100)
|
|
126
|
+
.optional()
|
|
127
|
+
.default(10)
|
|
128
|
+
.describe('Maximum number of results to return'),
|
|
129
|
+
},
|
|
130
|
+
execute: executeMemSearch,
|
|
131
|
+
}),
|
|
132
|
+
mem_forget: tool({
|
|
133
|
+
description: 'Remove a specific memory from Ultra Memory by its ID',
|
|
134
|
+
args: {
|
|
135
|
+
id: z
|
|
136
|
+
.string()
|
|
137
|
+
.uuid()
|
|
138
|
+
.describe('UUID of the memory to delete'),
|
|
139
|
+
},
|
|
140
|
+
execute: executeMemForget,
|
|
141
|
+
}),
|
|
142
|
+
mem_stats: tool({
|
|
143
|
+
description: 'Get statistics about stored memories — counts by type, total entries',
|
|
144
|
+
args: {},
|
|
145
|
+
execute: executeMemStats,
|
|
146
|
+
}),
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
export default pluginModule;
|
|
152
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kEAAkE;AAClE,+CAA+C;AAC/C,+EAA+E;AAE/E,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAE1B,8EAA8E;AAC9E,4EAA4E;AAC5E,IAAI,YAAY,GAAuD,IAAI,CAAC;AAE5E,8EAA8E;AAC9E,0EAA0E;AAC1E,uEAAuE;AACvE,8CAA8C;AAC9C,8EAA8E;AAE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AAC;6BACJ,IAAI,CAAC;4BACJ,cAAc;4BACd,YAAY;4BACZ,iBAAiB;4BACjB,SAAS;4BACT,SAAS;4BACT,UAAU;4BACV,UAAU;yBACX,CAAC;6BACD,QAAQ,EAAE;6BACV,QAAQ,CAAC,gCAAgC,CAAC;wBAC7C,KAAK,EAAE,CAAC;6BACL,MAAM,EAAE;6BACR,GAAG,EAAE;6BACL,GAAG,CAAC,CAAC,CAAC;6BACN,GAAG,CAAC,GAAG,CAAC;6BACR,QAAQ,EAAE;6BACV,OAAO,CAAC,EAAE,CAAC;6BACX,QAAQ,CAAC,qCAAqC,CAAC;qBACnD;oBACD,OAAO,EAAE,gBAAgB;iBAC1B,CAAC;gBAEF,UAAU,EAAE,IAAI,CAAC;oBACf,WAAW,EACT,sDAAsD;oBACxD,IAAI,EAAE;wBACJ,EAAE,EAAE,CAAC;6BACF,MAAM,EAAE;6BACR,IAAI,EAAE;6BACN,QAAQ,CAAC,8BAA8B,CAAC;qBAC5C;oBACD,OAAO,EAAE,gBAAgB;iBAC1B,CAAC;gBAEF,SAAS,EAAE,IAAI,CAAC;oBACd,WAAW,EACT,sEAAsE;oBACxE,IAAI,EAAE,EAAE;oBACR,OAAO,EAAE,eAAe;iBACzB,CAAC;aACH;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface InstallerResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
steps: string[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Run the full installation pipeline:
|
|
7
|
+
*
|
|
8
|
+
* 1. Detect platform
|
|
9
|
+
* 2. Detect package manager
|
|
10
|
+
* 3. Check PostgreSQL installed
|
|
11
|
+
* 4. Install PostgreSQL (if needed)
|
|
12
|
+
* 5. Create ultra_memory database
|
|
13
|
+
* 6. Run schema migrations
|
|
14
|
+
* 7. Health check
|
|
15
|
+
*
|
|
16
|
+
* Returns a summary with success status and step log.
|
|
17
|
+
*/
|
|
18
|
+
export declare function runInstaller(): Promise<InstallerResult>;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/installer/index.ts"],"names":[],"mappings":"AA+fA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,eAAe,CAAC,CA4I7D"}
|