opencode-rag-plugin 2.11.1 → 2.12.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 +305 -207
- package/dist/cli/commands/backend-detect.d.ts +1 -1
- package/dist/cli/commands/backend-detect.js +1 -1
- package/dist/cli/commands/index.d.ts +0 -1
- package/dist/cli/commands/index.js +0 -1
- package/dist/cli/commands/setup.js +271 -85
- package/dist/cli/commands/{init-helpers.d.ts → workspace-helpers.d.ts} +10 -7
- package/dist/cli/commands/{init-helpers.js → workspace-helpers.js} +12 -62
- package/dist/cli/index.js +1 -2
- package/dist/cli/prompt.d.ts +84 -0
- package/dist/cli/prompt.js +247 -0
- package/dist/cli/types.d.ts +16 -17
- package/dist/cli/wizard/apply.d.ts +58 -0
- package/dist/cli/wizard/apply.js +234 -0
- package/dist/cli/wizard/flow.d.ts +83 -0
- package/dist/cli/wizard/flow.js +759 -0
- package/dist/cli/wizard/model-catalog.d.ts +80 -0
- package/dist/cli/wizard/model-catalog.js +414 -0
- package/dist/cli/wizard/types.d.ts +94 -0
- package/dist/cli/wizard/types.js +5 -0
- package/dist/cli/workspace.d.ts +40 -0
- package/dist/cli/workspace.js +322 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/core/config.d.ts +2 -2
- package/dist/core/config.js +2 -2
- package/dist/core/provider-defaults.d.ts +2 -0
- package/dist/core/provider-defaults.js +4 -0
- package/dist/eval/fast-index.js +1 -1
- package/dist/opencode/system-guidance.d.ts +1 -1
- package/dist/opencode/system-guidance.js +1 -1
- package/dist/plugin.d.ts +13 -0
- package/dist/plugin.js +77 -8
- package/dist/tui.d.ts +11 -0
- package/dist/tui.js +12 -1
- package/package.json +1 -1
- package/dist/cli/commands/init.d.ts +0 -51
- package/dist/cli/commands/init.js +0 -508
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Interactive `setup` wizard.
|
|
3
|
+
*
|
|
4
|
+
* The flow is deliberately linear and every question has a default taken from
|
|
5
|
+
* the effective configuration, so pressing Enter through the wizard keeps an
|
|
6
|
+
* existing setup intact. Any prompt resolving `undefined` (Ctrl+C / Ctrl+D)
|
|
7
|
+
* aborts the whole wizard: no configuration is written.
|
|
8
|
+
*/
|
|
9
|
+
import { type ProxyConfig } from "../../core/config.js";
|
|
10
|
+
import type { Prompter } from "../prompt.js";
|
|
11
|
+
import type { WizardAnswers } from "./types.js";
|
|
12
|
+
/** Flags that pre-fill the wizard and make it scriptable. */
|
|
13
|
+
export interface WizardFlags {
|
|
14
|
+
/** Provider id (`ollama`, `openai`, `cohere`, `anthropic`, `google`). */
|
|
15
|
+
provider?: string;
|
|
16
|
+
/** Base URL for the provider. */
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
/** API key (or `env:NAME` to read an environment variable). */
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
/** Embedding model id. */
|
|
21
|
+
embeddingModel?: string;
|
|
22
|
+
/** Description model id (implies the feature is on). */
|
|
23
|
+
descriptionModel?: string;
|
|
24
|
+
/** Vision model id (implies the feature is on). */
|
|
25
|
+
visionModel?: string;
|
|
26
|
+
/** Decision model id (implies the feature is on). */
|
|
27
|
+
decisionModel?: string;
|
|
28
|
+
/** Explicit on/off for chunk descriptions. */
|
|
29
|
+
description?: boolean;
|
|
30
|
+
/** Explicit on/off for image descriptions. */
|
|
31
|
+
vision?: boolean;
|
|
32
|
+
/** Explicit on/off for the decision model. */
|
|
33
|
+
decision?: boolean;
|
|
34
|
+
/** Explicit on/off for reranking. */
|
|
35
|
+
reranking?: boolean;
|
|
36
|
+
/** Explicit on/off for the shell guard. */
|
|
37
|
+
shellGuard?: boolean;
|
|
38
|
+
/** Explicit on/off for passive quirk capture. */
|
|
39
|
+
memoryCapture?: boolean;
|
|
40
|
+
/** Vector-store backend (`lancedb` or `clickhouse`). */
|
|
41
|
+
vectorStore?: string;
|
|
42
|
+
/** ClickHouse endpoint. */
|
|
43
|
+
clickhouseUrl?: string;
|
|
44
|
+
/** ClickHouse database. */
|
|
45
|
+
clickhouseDatabase?: string;
|
|
46
|
+
/** ClickHouse user. */
|
|
47
|
+
clickhouseUser?: string;
|
|
48
|
+
/** Env var holding the ClickHouse password. */
|
|
49
|
+
clickhousePasswordEnv?: string;
|
|
50
|
+
/** ClickHouse project namespace. */
|
|
51
|
+
clickhouseNamespace?: string;
|
|
52
|
+
}
|
|
53
|
+
/** Inputs for {@link runSetupWizard}. */
|
|
54
|
+
export interface WizardRunOptions extends WizardFlags {
|
|
55
|
+
/** Prompter to use (interactive by construction). */
|
|
56
|
+
prompter: Prompter;
|
|
57
|
+
/** Effective raw config (global < workspace) used to pre-fill defaults. */
|
|
58
|
+
existing: Record<string, unknown>;
|
|
59
|
+
/** Proxy settings inherited from the current embedding config. */
|
|
60
|
+
proxy?: ProxyConfig;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Whether the caller passed any flag that should override the stored config.
|
|
64
|
+
*
|
|
65
|
+
* `setup` only rewrites configuration when the wizard ran, when a flag was
|
|
66
|
+
* supplied, or when no config exists yet.
|
|
67
|
+
*/
|
|
68
|
+
export declare function hasExplicitSetupFlags(flags: WizardFlags): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Build answers from CLI flags plus the existing config, for non-interactive
|
|
71
|
+
* runs (`--yes`, CI, piped stdin).
|
|
72
|
+
*
|
|
73
|
+
* Only used when at least one explicit flag is present; otherwise `setup`
|
|
74
|
+
* leaves the stored configuration alone.
|
|
75
|
+
*/
|
|
76
|
+
export declare function answersFromFlags(flags: WizardFlags, existing: Record<string, unknown>): WizardAnswers;
|
|
77
|
+
/**
|
|
78
|
+
* Run the interactive wizard.
|
|
79
|
+
*
|
|
80
|
+
* @returns The collected answers, or `undefined` when the user cancelled or
|
|
81
|
+
* declined to apply the configuration.
|
|
82
|
+
*/
|
|
83
|
+
export declare function runSetupWizard(options: WizardRunOptions): Promise<WizardAnswers | undefined>;
|