@howaboua/opencode-chat 0.1.6 → 0.1.8
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 +4 -4
- package/dist/script/download-model.d.ts +1 -0
- package/dist/script/download-model.js +2 -1
- package/dist/script/semantic-index.d.ts +1 -0
- package/dist/script/semantic-index.js +3 -2
- package/dist/semantic/index.d.ts +1 -1
- package/dist/semantic/index.d.ts.map +1 -1
- package/dist/semantic/index.js +3 -3
- package/dist/tools/bash.js +1 -1
- package/dist/tools/batch.d.ts +1 -1
- package/dist/tools/batch.d.ts.map +1 -1
- package/dist/tools/edit.js +2 -2
- package/dist/tools/glob.js +1 -1
- package/dist/tools/grep.js +3 -3
- package/dist/tools/patch.js +1 -1
- package/dist/tools/read.js +3 -3
- package/dist/tools/semantic-search.js +1 -1
- package/dist/tools/todo.d.ts +1 -1
- package/dist/tools/todo.d.ts.map +1 -1
- package/dist/tools/todo.js +1 -1
- package/dist/tools/write.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ OpenCode automatically installs the plugin on next launch.
|
|
|
41
41
|
|
|
42
42
|
```json
|
|
43
43
|
{
|
|
44
|
-
"plugin": ["@howaboua/opencode-chat@0.1.
|
|
44
|
+
"plugin": ["@howaboua/opencode-chat@0.1.7"]
|
|
45
45
|
}
|
|
46
46
|
```
|
|
47
47
|
|
|
@@ -61,11 +61,11 @@ For new projects or directories with fewer than 100 files, just launch OpenCode.
|
|
|
61
61
|
```bash
|
|
62
62
|
cd your-project
|
|
63
63
|
|
|
64
|
-
# Download the embedding model first
|
|
65
|
-
|
|
64
|
+
# Download the embedding model first (requires Bun)
|
|
65
|
+
bunx --bun @howaboua/opencode-chat opencode-chat-download-model
|
|
66
66
|
|
|
67
67
|
# Index your files (may take several minutes for large directories)
|
|
68
|
-
|
|
68
|
+
bunx --bun @howaboua/opencode-chat opencode-chat-semantic-index --mode full
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
After this one-time setup, OpenCode will launch normally and only re-index changed files.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
1
2
|
/**
|
|
2
3
|
* Download embedding model for semantic search.
|
|
3
|
-
* Usage:
|
|
4
|
+
* Usage: npx @howaboua/opencode-chat opencode-chat-download-model
|
|
4
5
|
* Automatically finds repo root by walking up to .opencode/
|
|
5
6
|
*/
|
|
6
7
|
import * as path from "path";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
1
2
|
/**
|
|
2
3
|
* Manual semantic indexer.
|
|
3
|
-
* Usage:
|
|
4
|
+
* Usage: npx @howaboua/opencode-chat opencode-chat-semantic-index --mode changed|full
|
|
4
5
|
* Automatically finds repo root by walking up to .opencode/
|
|
5
6
|
*/
|
|
6
7
|
import * as path from "path";
|
|
7
8
|
import * as fs from "fs/promises";
|
|
8
|
-
import { ensureSemanticIndex } from "../semantic";
|
|
9
|
+
import { ensureSemanticIndex } from "../semantic/index.js";
|
|
9
10
|
async function findRepoRoot(start) {
|
|
10
11
|
let dir = start;
|
|
11
12
|
while (dir !== "/") {
|
package/dist/semantic/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../semantic/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../semantic/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAoC3C,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAA;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAoDD,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;;;;;;;;;;;;;;;;GAwGrF;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;UAQzE,MAAM;gBACA,MAAM;cACR,MAAM;aACP,MAAM;eACJ,UAAU;KAQxB"}
|
package/dist/semantic/index.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import * as fs from "fs/promises";
|
|
7
7
|
import { Database } from "bun:sqlite";
|
|
8
|
-
import { chunkFile } from "./chunker";
|
|
9
|
-
import { getEmbedder, encodeEmbedding, decodeEmbedding, cosineSimilarity, getModelDir } from "./embedder";
|
|
10
|
-
export { ensureModel } from "./embedder";
|
|
8
|
+
import { chunkFile } from "./chunker.js";
|
|
9
|
+
import { getEmbedder, encodeEmbedding, decodeEmbedding, cosineSimilarity, getModelDir } from "./embedder.js";
|
|
10
|
+
export { ensureModel } from "./embedder.js";
|
|
11
11
|
const DB_FILENAME = "semantic.sqlite";
|
|
12
12
|
const MAX_FILE_BYTES = 1024 * 1024;
|
|
13
13
|
const MAX_CHUNKS_PER_FILE = 200;
|
package/dist/tools/bash.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Keeps output size bounded for predictable responses.
|
|
5
5
|
*/
|
|
6
6
|
import { tool } from "@opencode-ai/plugin";
|
|
7
|
-
import { MAX_OUTPUT_LENGTH } from "../util/constants";
|
|
7
|
+
import { MAX_OUTPUT_LENGTH } from "../util/constants.js";
|
|
8
8
|
export function createChatBash(baseDir) {
|
|
9
9
|
const run = async (args) => {
|
|
10
10
|
if (!args.command) {
|
package/dist/tools/batch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToolCall } from "../util/types";
|
|
1
|
+
import type { ToolCall } from "../util/types.js";
|
|
2
2
|
type Runner = (params: Record<string, unknown>) => Promise<string>;
|
|
3
3
|
export declare function createChatBatch(runners: Record<string, Runner>, todoRead: () => Promise<string>): {
|
|
4
4
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../tools/batch.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../tools/batch.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEhD,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAElE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC;;gBAoB1E;QAAE,UAAU,EAAE,QAAQ,EAAE,CAAA;KAAE;;;;;;;;;;;;;;;;EA2B/C"}
|
package/dist/tools/edit.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
import * as fs from "fs/promises";
|
|
7
7
|
import path from "path";
|
|
8
8
|
import { tool } from "@opencode-ai/plugin";
|
|
9
|
-
import { resolvePath } from "../util/paths";
|
|
10
|
-
import { replaceOnce } from "../util/text";
|
|
9
|
+
import { resolvePath } from "../util/paths.js";
|
|
10
|
+
import { replaceOnce } from "../util/text.js";
|
|
11
11
|
export function createChatEdit(baseDir, repoRoot) {
|
|
12
12
|
const run = async (args) => {
|
|
13
13
|
const filePath = resolvePath(baseDir, args.filePath);
|
package/dist/tools/glob.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Mirrors core behavior with truncation hints for large result sets.
|
|
5
5
|
*/
|
|
6
6
|
import { tool } from "@opencode-ai/plugin";
|
|
7
|
-
import { resolvePath } from "../util/paths";
|
|
7
|
+
import { resolvePath } from "../util/paths.js";
|
|
8
8
|
export function createChatGlob(baseDir) {
|
|
9
9
|
const run = async (args) => {
|
|
10
10
|
const searchRoot = resolvePath(baseDir, args.path ?? baseDir);
|
package/dist/tools/grep.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import * as fs from "fs/promises";
|
|
7
7
|
import { tool } from "@opencode-ai/plugin";
|
|
8
|
-
import { MAX_GREP_MATCHES } from "../util/constants";
|
|
9
|
-
import { resolvePath, isBinaryFile } from "../util/paths";
|
|
10
|
-
import { trimLine } from "../util/text";
|
|
8
|
+
import { MAX_GREP_MATCHES } from "../util/constants.js";
|
|
9
|
+
import { resolvePath, isBinaryFile } from "../util/paths.js";
|
|
10
|
+
import { trimLine } from "../util/text.js";
|
|
11
11
|
function formatMatches(matches, truncated) {
|
|
12
12
|
const outputLines = [`Found ${matches.length} matches`];
|
|
13
13
|
let currentFile = "";
|
package/dist/tools/patch.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { tool } from "@opencode-ai/plugin";
|
|
6
6
|
import * as path from "path";
|
|
7
|
-
import { parsePatch, applyHunksToFiles } from "../util/patch";
|
|
7
|
+
import { parsePatch, applyHunksToFiles } from "../util/patch.js";
|
|
8
8
|
export function createChatPatch(baseDir) {
|
|
9
9
|
const run = async (args) => {
|
|
10
10
|
const { hunks } = parsePatch(args.patchText);
|
package/dist/tools/read.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import * as fs from "fs/promises";
|
|
7
7
|
import { tool } from "@opencode-ai/plugin";
|
|
8
|
-
import { DEFAULT_READ_LIMIT } from "../util/constants";
|
|
9
|
-
import { resolvePath, isBlockedEnvPath, isImageExtension, isBinaryFile } from "../util/paths";
|
|
10
|
-
import { trimLine } from "../util/text";
|
|
8
|
+
import { DEFAULT_READ_LIMIT } from "../util/constants.js";
|
|
9
|
+
import { resolvePath, isBlockedEnvPath, isImageExtension, isBinaryFile } from "../util/paths.js";
|
|
10
|
+
import { trimLine } from "../util/text.js";
|
|
11
11
|
export function createChatRead(baseDir) {
|
|
12
12
|
const run = async (args) => {
|
|
13
13
|
const filePath = resolvePath(baseDir, args.filePath);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import { tool } from "@opencode-ai/plugin";
|
|
7
|
-
import { semanticSearch } from "../semantic";
|
|
7
|
+
import { semanticSearch } from "../semantic/index.js";
|
|
8
8
|
const DEFAULT_LIMIT = 5;
|
|
9
9
|
export function createChatSemanticSearch(worktree) {
|
|
10
10
|
const run = async (args) => {
|
package/dist/tools/todo.d.ts
CHANGED
package/dist/tools/todo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todo.d.ts","sourceRoot":"","sources":["../../tools/todo.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"todo.d.ts","sourceRoot":"","sources":["../../tools/todo.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAGhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;gCAOrB,CAAA;AAEF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM;;;oBAClB;YAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CjD"}
|
package/dist/tools/todo.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Deletes the file when all tasks are completed.
|
|
5
5
|
*/
|
|
6
6
|
import { tool } from "@opencode-ai/plugin";
|
|
7
|
-
import { readTodoFile, writeTodoFile } from "../util/todo";
|
|
7
|
+
import { readTodoFile, writeTodoFile } from "../util/todo.js";
|
|
8
8
|
export const todoSchema = tool.schema.object({
|
|
9
9
|
content: tool.schema.string().describe("Brief description of the task"),
|
|
10
10
|
status: tool.schema
|
package/dist/tools/write.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import * as fs from "fs/promises";
|
|
7
7
|
import path from "path";
|
|
8
8
|
import { tool } from "@opencode-ai/plugin";
|
|
9
|
-
import { resolvePath } from "../util/paths";
|
|
9
|
+
import { resolvePath } from "../util/paths.js";
|
|
10
10
|
export function createChatWrite(baseDir, repoRoot) {
|
|
11
11
|
const run = async (args) => {
|
|
12
12
|
const filePath = resolvePath(baseDir, args.filePath);
|