@cortexkit/opencode-magic-context 0.16.0 → 0.16.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 +22 -15
- package/dist/config/schema/magic-context.d.ts +29 -0
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/queue.d.ts +18 -4
- package/dist/features/magic-context/dreamer/queue.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/runner.d.ts +14 -0
- package/dist/features/magic-context/dreamer/runner.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/scheduler.d.ts +13 -1
- package/dist/features/magic-context/dreamer/scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +7 -0
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +15 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/index.js +52 -17
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/package.json +73 -77
- package/dist/cli/config-paths.d.ts +0 -11
- package/dist/cli/config-paths.d.ts.map +0 -1
- package/dist/cli/diagnostics.d.ts +0 -82
- package/dist/cli/diagnostics.d.ts.map +0 -1
- package/dist/cli/doctor.d.ts +0 -5
- package/dist/cli/doctor.d.ts.map +0 -1
- package/dist/cli/index.d.ts +0 -3
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/logs.d.ts +0 -22
- package/dist/cli/logs.d.ts.map +0 -1
- package/dist/cli/migrate.d.ts +0 -70
- package/dist/cli/migrate.d.ts.map +0 -1
- package/dist/cli/opencode-helpers.d.ts +0 -19
- package/dist/cli/opencode-helpers.d.ts.map +0 -1
- package/dist/cli/prompts.d.ts +0 -14
- package/dist/cli/prompts.d.ts.map +0 -1
- package/dist/cli/setup.d.ts +0 -2
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli.js +0 -11924
package/package.json
CHANGED
|
@@ -1,79 +1,75 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
],
|
|
76
|
-
"peerDependencies": {
|
|
77
|
-
"@opencode-ai/plugin": ">=1.2.0"
|
|
78
|
-
}
|
|
2
|
+
"name": "@cortexkit/opencode-magic-context",
|
|
3
|
+
"version": "0.16.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"author": "ualtinok",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"opencode",
|
|
12
|
+
"plugin",
|
|
13
|
+
"context",
|
|
14
|
+
"memory",
|
|
15
|
+
"ai",
|
|
16
|
+
"llm",
|
|
17
|
+
"prompt-caching",
|
|
18
|
+
"session-history"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/cortexkit/magic-context",
|
|
23
|
+
"directory": "packages/plugin"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"src/tui",
|
|
28
|
+
"src/shared",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "bun build src/index.ts --outdir dist --target node --format esm --external @opencode-ai/plugin --external @huggingface/transformers --external better-sqlite3 --external bun:sqlite && tsc --emitDeclarationOnly",
|
|
33
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.scripts.json",
|
|
34
|
+
"test": "bun test",
|
|
35
|
+
"lint": "biome check .",
|
|
36
|
+
"lint:fix": "biome check --write .",
|
|
37
|
+
"format": "biome format --write .",
|
|
38
|
+
"format:check": "biome format .",
|
|
39
|
+
"clean": "rm -rf dist",
|
|
40
|
+
"prepublishOnly": "bun run build"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@huggingface/transformers": "^4.1.0",
|
|
44
|
+
"@opencode-ai/plugin": "^1.2.26",
|
|
45
|
+
"@opencode-ai/sdk": "^1.2.26",
|
|
46
|
+
"ai-tokenizer": "^1.0.6",
|
|
47
|
+
"better-sqlite3": "^12.9.0",
|
|
48
|
+
"comment-json": "^4.2.5",
|
|
49
|
+
"zod": "^4.1.8"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@biomejs/biome": "^2.4.7",
|
|
53
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
54
|
+
"@types/node": "^22.0.0",
|
|
55
|
+
"bun-types": "^1.3.10",
|
|
56
|
+
"typescript": "^5.8.0"
|
|
57
|
+
},
|
|
58
|
+
"exports": {
|
|
59
|
+
".": {
|
|
60
|
+
"types": "./dist/index.d.ts",
|
|
61
|
+
"import": "./dist/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./tui": {
|
|
64
|
+
"types": "./src/tui/index.tsx",
|
|
65
|
+
"import": "./src/tui/index.tsx"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"oc-plugin": [
|
|
69
|
+
"server",
|
|
70
|
+
"tui"
|
|
71
|
+
],
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@opencode-ai/plugin": ">=1.2.0"
|
|
74
|
+
}
|
|
79
75
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface ConfigPaths {
|
|
2
|
-
configDir: string;
|
|
3
|
-
opencodeConfig: string;
|
|
4
|
-
opencodeConfigFormat: "json" | "jsonc" | "none";
|
|
5
|
-
magicContextConfig: string;
|
|
6
|
-
omoConfig: string | null;
|
|
7
|
-
tuiConfig: string;
|
|
8
|
-
tuiConfigFormat: "json" | "jsonc" | "none";
|
|
9
|
-
}
|
|
10
|
-
export declare function detectConfigPaths(): ConfigPaths;
|
|
11
|
-
//# sourceMappingURL=config-paths.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-paths.d.ts","sourceRoot":"","sources":["../../src/cli/config-paths.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAChD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CAC9C;AA+BD,wBAAgB,iBAAiB,IAAI,WAAW,CA6C/C"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { type ConfigPaths } from "./config-paths";
|
|
2
|
-
export interface DiagnosticReport {
|
|
3
|
-
timestamp: string;
|
|
4
|
-
platform: string;
|
|
5
|
-
arch: string;
|
|
6
|
-
nodeVersion: string;
|
|
7
|
-
pluginVersion: string;
|
|
8
|
-
opencodeInstalled: boolean;
|
|
9
|
-
opencodeVersion: string | null;
|
|
10
|
-
configPaths: ConfigPaths;
|
|
11
|
-
opencodeConfigHasPlugin: boolean;
|
|
12
|
-
tuiConfigHasPlugin: boolean;
|
|
13
|
-
magicContextConfig: {
|
|
14
|
-
exists: boolean;
|
|
15
|
-
parseError?: string;
|
|
16
|
-
flags: Record<string, unknown>;
|
|
17
|
-
};
|
|
18
|
-
pluginCache: {
|
|
19
|
-
path: string;
|
|
20
|
-
cached?: string;
|
|
21
|
-
latest?: string;
|
|
22
|
-
};
|
|
23
|
-
storageDir: {
|
|
24
|
-
path: string;
|
|
25
|
-
exists: boolean;
|
|
26
|
-
contextDbSizeBytes: number;
|
|
27
|
-
};
|
|
28
|
-
conflicts: {
|
|
29
|
-
hasConflict: boolean;
|
|
30
|
-
reasons: string[];
|
|
31
|
-
};
|
|
32
|
-
logFile: {
|
|
33
|
-
path: string;
|
|
34
|
-
exists: boolean;
|
|
35
|
-
sizeKb: number;
|
|
36
|
-
};
|
|
37
|
-
historianDumps: {
|
|
38
|
-
dir: string;
|
|
39
|
-
count: number;
|
|
40
|
-
recent: HistorianDumpSummary[];
|
|
41
|
-
};
|
|
42
|
-
/** Most recent historian-failure rows from session_meta across all sessions. */
|
|
43
|
-
historianFailures: HistorianFailureSummary[];
|
|
44
|
-
}
|
|
45
|
-
export interface HistorianDumpSummary {
|
|
46
|
-
name: string;
|
|
47
|
-
ageMinutes: number;
|
|
48
|
-
sizeKb: number;
|
|
49
|
-
/** Parsed metadata — only structural fields, never raw XML content. */
|
|
50
|
-
meta?: HistorianDumpMeta;
|
|
51
|
-
/** If the XML could not be parsed, reason for failure. */
|
|
52
|
-
parseError?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface HistorianDumpMeta {
|
|
55
|
-
/** Number of <compartment> elements found. */
|
|
56
|
-
compartmentCount: number;
|
|
57
|
-
/** Smallest start ordinal across compartments, or null if none. */
|
|
58
|
-
minStart: number | null;
|
|
59
|
-
/** Largest end ordinal across compartments, or null if none. */
|
|
60
|
-
maxEnd: number | null;
|
|
61
|
-
/** Value of <unprocessed_from> tag, if present. */
|
|
62
|
-
unprocessedFrom: number | null;
|
|
63
|
-
/** Number of <fact> items grouped by category. */
|
|
64
|
-
factCountByCategory: Record<string, number>;
|
|
65
|
-
/** Number of <user_observations> items. */
|
|
66
|
-
userObservationCount: number;
|
|
67
|
-
/** Total number of compartment ordinal gaps (missing ranges between consecutive compartments). */
|
|
68
|
-
ordinalGapCount: number;
|
|
69
|
-
/** Total number of overlapping compartment ranges. */
|
|
70
|
-
ordinalOverlapCount: number;
|
|
71
|
-
}
|
|
72
|
-
export interface HistorianFailureSummary {
|
|
73
|
-
sessionId: string;
|
|
74
|
-
failureCount: number;
|
|
75
|
-
/** Sanitized truncated last-error text. May be empty if never set. */
|
|
76
|
-
lastError: string;
|
|
77
|
-
/** ISO timestamp of last failure, or empty if never failed. */
|
|
78
|
-
lastFailureAt: string;
|
|
79
|
-
}
|
|
80
|
-
export declare function collectDiagnostics(): Promise<DiagnosticReport>;
|
|
81
|
-
export declare function renderDiagnosticsMarkdown(report: DiagnosticReport): string;
|
|
82
|
-
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/cli/diagnostics.ts"],"names":[],"mappings":"AAgBA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oB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAC9B,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gEAAgE;IAChE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mDAAmD;IACnD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kDAAkD;IAClD,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,2CAA2C;IAC3C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kGAAkG;IAClG,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAC;CACzB;AA6RD,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAgDpE;AASD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CA8E1E"}
|
package/dist/cli/doctor.d.ts
DELETED
package/dist/cli/doctor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA4WA,wBAAsB,SAAS,CAC3B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,OAAO,CAAC,MAAM,CAAC,CAyejB"}
|
package/dist/cli/index.d.ts
DELETED
package/dist/cli/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
package/dist/cli/logs.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type DiagnosticReport } from "./diagnostics";
|
|
2
|
-
/**
|
|
3
|
-
* Replace absolute home paths, usernames, and known secret-token shapes in
|
|
4
|
-
* captured log lines so users can share reports publicly without leaking
|
|
5
|
-
* local paths or credentials.
|
|
6
|
-
*
|
|
7
|
-
* Order of operations matters:
|
|
8
|
-
* 1. Path/user redaction first — paths are deterministic and the
|
|
9
|
-
* easiest to match, doing them before token redaction means
|
|
10
|
-
* tokens never appear inside a path-resolved replacement.
|
|
11
|
-
* 2. Secret-token redaction in `SECRET_PATTERNS` order — more
|
|
12
|
-
* specific shapes (provider-prefixed keys) before generic
|
|
13
|
-
* assignment patterns, so a known shape doesn't get caught
|
|
14
|
-
* twice.
|
|
15
|
-
*/
|
|
16
|
-
export declare function sanitizeLogContent(content: string): string;
|
|
17
|
-
export interface BundledIssueReport {
|
|
18
|
-
path: string;
|
|
19
|
-
bodyMarkdown: string;
|
|
20
|
-
}
|
|
21
|
-
export declare function bundleIssueReport(report: DiagnosticReport, description: string, _title: string): Promise<BundledIssueReport>;
|
|
22
|
-
//# sourceMappingURL=logs.d.ts.map
|
package/dist/cli/logs.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/cli/logs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,gBAAgB,EAA6B,MAAM,eAAe,CAAC;AAoHjF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAiC1D;AAeD,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACxB;AA0CD,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,CAAC,CAkD7B"}
|
package/dist/cli/migrate.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { Database as DatabaseType } from "../shared/sqlite";
|
|
2
|
-
export interface MigrateOpenCodeSessionToPiOptions {
|
|
3
|
-
/**
|
|
4
|
-
* OpenCode source DB handle. Read-only operations: session, message,
|
|
5
|
-
* part rows. Owns nothing about Magic Context state — that lives in
|
|
6
|
-
* the cortexkit DB below.
|
|
7
|
-
*/
|
|
8
|
-
db?: DatabaseLike;
|
|
9
|
-
/**
|
|
10
|
-
* Magic Context shared-DB handle (`~/.local/share/cortexkit/magic-context/context.db`).
|
|
11
|
-
* The migrator reads source compartments + facts under
|
|
12
|
-
* `harness='opencode'` keyed by source session_id and writes copies
|
|
13
|
-
* keyed by the new Pi session_id under `harness='pi'`. When omitted,
|
|
14
|
-
* the migrator opens the canonical path read-write.
|
|
15
|
-
*
|
|
16
|
-
* Pass `null` explicitly to skip the cortexkit copy entirely (the
|
|
17
|
-
* legacy V1 behavior — JSONL only).
|
|
18
|
-
*/
|
|
19
|
-
cortexkitDb?: DatabaseLike | null;
|
|
20
|
-
fs?: FileSystemLike;
|
|
21
|
-
now?: Date;
|
|
22
|
-
sessionId: string;
|
|
23
|
-
maxMessages?: number;
|
|
24
|
-
dryRun?: boolean;
|
|
25
|
-
opencodeDbPath?: string;
|
|
26
|
-
piSessionsRoot?: string;
|
|
27
|
-
provider?: string;
|
|
28
|
-
modelId?: string;
|
|
29
|
-
}
|
|
30
|
-
export interface MigrationResult {
|
|
31
|
-
outputPath: string;
|
|
32
|
-
piSessionId: string;
|
|
33
|
-
messageCount: number;
|
|
34
|
-
byteCount: number;
|
|
35
|
-
sourceMessageCount: number;
|
|
36
|
-
/** Number of OpenCode compartments copied to the new Pi session_id. */
|
|
37
|
-
compartmentsCopied: number;
|
|
38
|
-
/** Number of OpenCode session_facts copied to the new Pi session_id. */
|
|
39
|
-
factsCopied: number;
|
|
40
|
-
/** Number of compartment boundaries that were nearest-at-or-before remapped (vs exact match). */
|
|
41
|
-
boundariesApproximated: number;
|
|
42
|
-
compactionMarkerWritten: boolean;
|
|
43
|
-
compactionBoundaryEntryId?: string;
|
|
44
|
-
compactionFirstKeptEntryId?: string;
|
|
45
|
-
dryRun: boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface MigrateCliOptions {
|
|
48
|
-
from?: string;
|
|
49
|
-
to?: string;
|
|
50
|
-
session?: string;
|
|
51
|
-
maxMessages?: number;
|
|
52
|
-
dryRun?: boolean;
|
|
53
|
-
}
|
|
54
|
-
type DatabaseLike = Pick<DatabaseType, "prepare" | "close" | "exec">;
|
|
55
|
-
type FileSystemLike = {
|
|
56
|
-
existsSync(path: string): boolean;
|
|
57
|
-
mkdirSync(path: string, options?: {
|
|
58
|
-
recursive?: boolean;
|
|
59
|
-
}): unknown;
|
|
60
|
-
writeFileSync(path: string, data: string): unknown;
|
|
61
|
-
};
|
|
62
|
-
export declare function projectPathToPiDirSlug(projectPath: string): string;
|
|
63
|
-
export declare function formatPiFilenameTimestamp(date: Date): string;
|
|
64
|
-
export declare function generateUuidV7(date?: Date): string;
|
|
65
|
-
export declare function migrateOpenCodeSessionToPi(opts: MigrateOpenCodeSessionToPiOptions): MigrationResult;
|
|
66
|
-
export declare function parseMigrateArgs(args: string[]): MigrateCliOptions;
|
|
67
|
-
export declare function printMigrateHelp(): void;
|
|
68
|
-
export declare function runMigrateCli(args: string[]): Promise<number>;
|
|
69
|
-
export {};
|
|
70
|
-
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-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E,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,KAAK,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAErE,KAAK,cAAc,GAAG;IAClB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC;IACpE,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACtD,CAAC;AAiHF,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE5D;AAED,wBAAgB,cAAc,CAAC,IAAI,OAAa,GAAG,MAAM,CAWxD;AA6nBD,wBAAgB,0BAA0B,CACtC,IAAI,EAAE,iCAAiC,GACxC,eAAe,CAqGjB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAkBlE;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CA2BvC;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA2CnE"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare function isOpenCodeInstalled(): boolean;
|
|
2
|
-
export declare function getOpenCodeVersion(): string | null;
|
|
3
|
-
export declare function getAvailableModels(): string[];
|
|
4
|
-
/** Group models by provider for display */
|
|
5
|
-
export declare function groupModelsByProvider(models: string[]): Map<string, string[]>;
|
|
6
|
-
/** Get unique providers from model list */
|
|
7
|
-
export declare function getProviders(models: string[]): string[];
|
|
8
|
-
/** Filter models matching any of the given patterns */
|
|
9
|
-
export declare function filterModels(models: string[], patterns: string[]): string[];
|
|
10
|
-
/**
|
|
11
|
-
* Build a curated model selection list for a given role.
|
|
12
|
-
* Returns models ordered by recommendation priority.
|
|
13
|
-
*/
|
|
14
|
-
export declare function buildModelSelection(allModels: string[], role: "historian" | "dreamer" | "sidekick"): {
|
|
15
|
-
label: string;
|
|
16
|
-
value: string;
|
|
17
|
-
recommended?: boolean;
|
|
18
|
-
}[];
|
|
19
|
-
//# sourceMappingURL=opencode-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-helpers.d.ts","sourceRoot":"","sources":["../../src/cli/opencode-helpers.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,IAAI,OAAO,CAO7C;AAED,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAMlD;AAED,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAU7C;AAED,2CAA2C;AAC3C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAU7E;AAED,2CAA2C;AAC3C,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CASvD;AAED,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAE3E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,MAAM,EAAE,EACnB,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,GAC3C;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,CA0D3D"}
|
package/dist/cli/prompts.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { intro, log, note, outro, spinner } from "@clack/prompts";
|
|
2
|
-
export { intro, log, note, outro, spinner };
|
|
3
|
-
export declare function confirm(message: string, defaultYes?: boolean): Promise<boolean>;
|
|
4
|
-
export declare function text(message: string, options?: {
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
initialValue?: string;
|
|
7
|
-
validate?: (value: string) => string | undefined;
|
|
8
|
-
}): Promise<string>;
|
|
9
|
-
export declare function selectOne(message: string, options: {
|
|
10
|
-
label: string;
|
|
11
|
-
value: string;
|
|
12
|
-
recommended?: boolean;
|
|
13
|
-
}[]): Promise<string>;
|
|
14
|
-
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,EAEL,GAAG,EACH,IAAI,EACJ,KAAK,EAEL,OAAO,EACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAiC5C,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAOlF;AAED,wBAAsB,IAAI,CACtB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IACL,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC/C,GACP,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,wBAAsB,SAAS,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,GACnE,OAAO,CAAC,MAAM,CAAC,CAWjB"}
|
package/dist/cli/setup.d.ts
DELETED
package/dist/cli/setup.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/cli/setup.ts"],"names":[],"mappings":"AA6JA,wBAAsB,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAyPhD"}
|