@cortexkit/opencode-magic-context 0.2.0 → 0.2.2
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 +41 -6
- package/dist/cli/config-paths.d.ts +9 -0
- package/dist/cli/config-paths.d.ts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/opencode-helpers.d.ts +19 -0
- package/dist/cli/opencode-helpers.d.ts.map +1 -0
- package/dist/cli/prompts.d.ts +12 -0
- package/dist/cli/prompts.d.ts.map +1 -0
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli.js +442 -0
- package/dist/config/schema/magic-context.d.ts +0 -14
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/queue.d.ts +0 -2
- package/dist/features/magic-context/dreamer/queue.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-cache.d.ts +8 -0
- package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/index.d.ts +1 -0
- package/dist/features/magic-context/memory/index.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +1 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/scheduler.d.ts +1 -1
- package/dist/features/magic-context/scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-ops.d.ts +0 -1
- package/dist/features/magic-context/storage-ops.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +1 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-id-fallback.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +1 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index.js +1206 -1052
- package/dist/plugin/dream-timer.d.ts +1 -1
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/shared/jsonc-parser.d.ts +0 -9
- package/dist/shared/jsonc-parser.d.ts.map +1 -1
- package/package.json +6 -2
- package/scripts/install.sh +35 -0
- package/dist/plugin/hooks/create-tag-content-resolver.d.ts +0 -7
- package/dist/plugin/hooks/create-tag-content-resolver.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAIpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC1C,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;CAChC,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAIpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC1C,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;CAChC,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAuC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAU7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;CAC1C;;;;;;qBAiBW,CAAJ;;;;;;;;;;;;qBAkBQ,CAAV;mBAAkB,CAAA;;;;;
|
|
1
|
+
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAU7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;CAC1C;;;;;;qBAiBW,CAAJ;;;;;;;;;;;;qBAkBQ,CAAV;mBAAkB,CAAA;;;;;0BAO03T,CAAC;;;;;;EADl5T"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
export interface JsoncParseResult<T> {
|
|
2
|
-
data: T | null;
|
|
3
|
-
errors: Array<{
|
|
4
|
-
message: string;
|
|
5
|
-
offset: number;
|
|
6
|
-
length: number;
|
|
7
|
-
}>;
|
|
8
|
-
}
|
|
9
1
|
export declare function parseJsonc<T = unknown>(content: string): T;
|
|
10
|
-
export declare function parseJsoncSafe<T = unknown>(content: string): JsoncParseResult<T>;
|
|
11
2
|
export declare function readJsoncFile<T = unknown>(filePath: string): T | null;
|
|
12
3
|
export declare function detectConfigFile(basePath: string): {
|
|
13
4
|
format: "json" | "jsonc" | "none";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonc-parser.d.ts","sourceRoot":"","sources":["../../src/shared/jsonc-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsonc-parser.d.ts","sourceRoot":"","sources":["../../src/shared/jsonc-parser.ts"],"names":[],"mappings":"AA4GA,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAG1D;AAED,wBAAgB,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAMrE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAChD,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CAChB,CAaA"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-magic-context",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"opencode-magic-context": "dist/cli.js"
|
|
10
|
+
},
|
|
8
11
|
"author": "ualtinok",
|
|
9
12
|
"license": "MIT",
|
|
10
13
|
"keywords": [
|
|
@@ -23,10 +26,11 @@
|
|
|
23
26
|
},
|
|
24
27
|
"files": [
|
|
25
28
|
"dist",
|
|
29
|
+
"scripts/install.sh",
|
|
26
30
|
"README.md"
|
|
27
31
|
],
|
|
28
32
|
"scripts": {
|
|
29
|
-
"build": "bun build src/index.ts --outdir dist --target bun --format esm --external @huggingface/transformers --external @opencode-ai/plugin && tsc --emitDeclarationOnly",
|
|
33
|
+
"build": "bun build src/index.ts --outdir dist --target bun --format esm --external @huggingface/transformers --external @opencode-ai/plugin && bun build src/cli/index.ts --outfile dist/cli.js --target node --format esm && tsc --emitDeclarationOnly",
|
|
30
34
|
"typecheck": "tsc --noEmit && tsc -p tsconfig.scripts.json",
|
|
31
35
|
"test": "bun test",
|
|
32
36
|
"lint": "biome check .",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Magic Context — Interactive Setup
|
|
5
|
+
# Usage: curl -fsSL https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/scripts/install.sh | bash
|
|
6
|
+
|
|
7
|
+
PACKAGE="@cortexkit/opencode-magic-context"
|
|
8
|
+
|
|
9
|
+
main() {
|
|
10
|
+
echo ""
|
|
11
|
+
echo " ✨ Magic Context — Setup"
|
|
12
|
+
echo " ────────────────────────"
|
|
13
|
+
echo ""
|
|
14
|
+
|
|
15
|
+
# Detect runtime
|
|
16
|
+
if command -v bun &>/dev/null; then
|
|
17
|
+
echo " → Using bun"
|
|
18
|
+
echo ""
|
|
19
|
+
bunx "$PACKAGE" setup
|
|
20
|
+
elif command -v npx &>/dev/null; then
|
|
21
|
+
echo " → Using npx"
|
|
22
|
+
echo ""
|
|
23
|
+
npx -y "$PACKAGE" setup
|
|
24
|
+
else
|
|
25
|
+
echo " ✗ Neither bun nor npx found."
|
|
26
|
+
echo ""
|
|
27
|
+
echo " Install one of:"
|
|
28
|
+
echo " • bun: curl -fsSL https://bun.sh/install | bash"
|
|
29
|
+
echo " • node: https://nodejs.org"
|
|
30
|
+
echo ""
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
main "$@"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { openDatabase } from "../../features/magic-context/storage";
|
|
2
|
-
import type { PluginContext } from "../types";
|
|
3
|
-
export declare function createTagContentResolver(ctx: PluginContext, db: ReturnType<typeof openDatabase>): {
|
|
4
|
-
resolveTagContent: (sessionId: string, tagId: number, skipCache?: boolean) => Promise<string | null>;
|
|
5
|
-
clearCache: (sessionId?: string) => void;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=create-tag-content-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-tag-content-resolver.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-tag-content-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAwC9C,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC;mCAsC7E,MAAM,SACV,MAAM,0BAEd,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;6BArCO,MAAM,KAAG,IAAI;EAuEhD"}
|