@breviqcode/cli 0.1.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/LICENSE +21 -0
- package/README.md +35 -0
- package/dist/config-resolver.d.ts +22 -0
- package/dist/config-resolver.d.ts.map +1 -0
- package/dist/config-resolver.js +66 -0
- package/dist/config-resolver.js.map +1 -0
- package/dist/custom-commands.d.ts +21 -0
- package/dist/custom-commands.d.ts.map +1 -0
- package/dist/custom-commands.js +73 -0
- package/dist/custom-commands.js.map +1 -0
- package/dist/flags.d.ts +11 -0
- package/dist/flags.d.ts.map +1 -0
- package/dist/flags.js +16 -0
- package/dist/flags.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +159 -0
- package/dist/index.js.map +1 -0
- package/dist/onboarding.d.ts +35 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +131 -0
- package/dist/onboarding.js.map +1 -0
- package/dist/prompt.d.ts +29 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +60 -0
- package/dist/prompt.js.map +1 -0
- package/dist/provider-presets.d.ts +22 -0
- package/dist/provider-presets.d.ts.map +1 -0
- package/dist/provider-presets.js +60 -0
- package/dist/provider-presets.js.map +1 -0
- package/dist/provider.d.ts +26 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +61 -0
- package/dist/provider.js.map +1 -0
- package/dist/runtime.d.ts +68 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +127 -0
- package/dist/runtime.js.map +1 -0
- package/dist/system-prompt.d.ts +17 -0
- package/dist/system-prompt.d.ts.map +1 -0
- package/dist/system-prompt.js +32 -0
- package/dist/system-prompt.js.map +1 -0
- package/dist/tui/App.d.ts +44 -0
- package/dist/tui/App.d.ts.map +1 -0
- package/dist/tui/App.js +894 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/format-tool-call.d.ts +35 -0
- package/dist/tui/format-tool-call.d.ts.map +1 -0
- package/dist/tui/format-tool-call.js +129 -0
- package/dist/tui/format-tool-call.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProjectInstructions } from "@breviqcode/core";
|
|
2
|
+
import type { AgentMode, Message } from "@breviqcode/shared";
|
|
3
|
+
/**
|
|
4
|
+
* Establishes what BreviqCode is and that it should actually use its
|
|
5
|
+
* tools, rather than just describe what it would do. Built in from the
|
|
6
|
+
* start this time — the Go version shipped without one for a while, and
|
|
7
|
+
* live testing found the model would produce an empty reply to something
|
|
8
|
+
* as simple as "go version" because it had no instruction that it was an
|
|
9
|
+
* agentic assistant meant to act. Never persisted to the session store;
|
|
10
|
+
* prepended fresh to the in-memory message list on every turn.
|
|
11
|
+
*
|
|
12
|
+
* `mode` is threaded through so a session started with `--plan` tells the
|
|
13
|
+
* model up front, rather than letting it discover the restriction only
|
|
14
|
+
* after a blocked tool call wastes a turn.
|
|
15
|
+
*/
|
|
16
|
+
export declare function systemMessage(projectRoot: string, mode?: AgentMode, instructions?: ProjectInstructions): Message;
|
|
17
|
+
//# sourceMappingURL=system-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5D;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,GAAE,SAAmB,EAAE,YAAY,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAoBzH"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Establishes what BreviqCode is and that it should actually use its
|
|
3
|
+
* tools, rather than just describe what it would do. Built in from the
|
|
4
|
+
* start this time — the Go version shipped without one for a while, and
|
|
5
|
+
* live testing found the model would produce an empty reply to something
|
|
6
|
+
* as simple as "go version" because it had no instruction that it was an
|
|
7
|
+
* agentic assistant meant to act. Never persisted to the session store;
|
|
8
|
+
* prepended fresh to the in-memory message list on every turn.
|
|
9
|
+
*
|
|
10
|
+
* `mode` is threaded through so a session started with `--plan` tells the
|
|
11
|
+
* model up front, rather than letting it discover the restriction only
|
|
12
|
+
* after a blocked tool call wastes a turn.
|
|
13
|
+
*/
|
|
14
|
+
export function systemMessage(projectRoot, mode = "build", instructions) {
|
|
15
|
+
const modeNote = mode === "plan"
|
|
16
|
+
? `\n\nYou are currently in PLAN MODE: only read-only tools (read_file, grep, glob, find_symbol, lsp, question) work right now — write_file, edit_file, apply_patch, and bash will be blocked. Investigate, then present your plan via exit_plan_mode once you're ready to make changes; only after the user approves it do write/execute tools become available.`
|
|
17
|
+
: "";
|
|
18
|
+
const instructionsBlock = instructions
|
|
19
|
+
? `\n\n---\nProject instructions (from ${instructions.source} at the project root) — follow these in addition to the rules above:\n\n${instructions.content}`
|
|
20
|
+
: "";
|
|
21
|
+
return {
|
|
22
|
+
role: "system",
|
|
23
|
+
content: `You are BreviqCode, an agentic coding assistant running in a terminal, working in the project at ${projectRoot}.
|
|
24
|
+
|
|
25
|
+
You have tools to read and search files (read_file, grep, glob, find_symbol, lsp), write and edit files (write_file, edit_file, apply_patch), and run shell commands (bash) in this project's directory. Use task to delegate a self-contained, read-only investigation (e.g. "find every caller of X and summarize") to a fresh sub-agent when that would keep your own context cleaner than doing the exploration yourself — not for every request, just genuinely large/independent research.
|
|
26
|
+
|
|
27
|
+
Use these tools proactively whenever the request calls for it: if the user names or describes a command, run it with bash rather than only describing what it would do; if asked about code, inspect the real files instead of guessing. Write/execute tool calls may require the user's separate confirmation — that is handled automatically outside this conversation, so just make the call.
|
|
28
|
+
|
|
29
|
+
Be concise and direct in your replies.${modeNote}${instructionsBlock}`,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=system-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,WAAmB,EAAE,OAAkB,OAAO,EAAE,YAAkC;IAC9G,MAAM,QAAQ,GACZ,IAAI,KAAK,MAAM;QACb,CAAC,CAAC,gWAAgW;QAClW,CAAC,CAAC,EAAE,CAAA;IAER,MAAM,iBAAiB,GAAG,YAAY;QACpC,CAAC,CAAC,uCAAuC,YAAY,CAAC,MAAM,2EAA2E,YAAY,CAAC,OAAO,EAAE;QAC7J,CAAC,CAAC,EAAE,CAAA;IAEN,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,oGAAoG,WAAW;;;;;;wCAMpF,QAAQ,GAAG,iBAAiB,EAAE;KACnE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { AgentMode } from "@breviqcode/shared";
|
|
2
|
+
/**
|
|
3
|
+
* The interactive, stay-open TUI — this project's equivalent of the Go
|
|
4
|
+
* version's Bubble Tea interface, built with Ink/React instead (matching
|
|
5
|
+
* Claude Code's own real stack, per the research behind this whole
|
|
6
|
+
* rewrite). Unlike the one-shot `breviq chat` command (send one message,
|
|
7
|
+
* stream the reply, exit), this keeps one process alive across many turns,
|
|
8
|
+
* reusing the exact same runtime wiring via `buildRuntime` — the same
|
|
9
|
+
* tools, gate, session store, symbol index, and LSP manager, just kept
|
|
10
|
+
* alive instead of torn down after one message.
|
|
11
|
+
*
|
|
12
|
+
* Tool calls render as a two-line "⏺ Label(args)" / " ⎿ detail" block —
|
|
13
|
+
* matching Claude Code's/OpenCode's own tool-call presentation — rather
|
|
14
|
+
* than a flat status line, and the input sits in a bordered box (colored
|
|
15
|
+
* by agent mode) rather than a plain text prompt, since a bare `[build] >`
|
|
16
|
+
* line was reported live as looking nothing like either tool's actual UI.
|
|
17
|
+
*
|
|
18
|
+
* The permission-confirmation `Prompter` and the `question` tool's `Asker`
|
|
19
|
+
* are implemented as plain closures over this component's own `useState`
|
|
20
|
+
* setters — no external pub/sub bridge needed, since `buildRuntime` (and
|
|
21
|
+
* everything it constructs) is only ever built *inside* this component's
|
|
22
|
+
* effect, after Ink already owns the render tree. Gate/tools calling
|
|
23
|
+
* `prompt()`/`ask()` from deep inside a tool-call chain just resolves to
|
|
24
|
+
* "set some state and return a Promise the state-driven UI resolves later"
|
|
25
|
+
* — normal React state updates are safe to call from any async context,
|
|
26
|
+
* not just event handlers.
|
|
27
|
+
*/
|
|
28
|
+
export declare function App({ continueSession, initialAgentMode, resumeSessionId, }: {
|
|
29
|
+
continueSession: boolean;
|
|
30
|
+
initialAgentMode: AgentMode;
|
|
31
|
+
resumeSessionId?: string;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* Entry point for the interactive TUI. If neither real env vars nor a
|
|
35
|
+
* saved config exist yet, runs the first-run onboarding wizard *before*
|
|
36
|
+
* Ink ever renders — `resolveConfig()` (called later, inside
|
|
37
|
+
* `buildRuntime`) would otherwise try to run that same readline-based
|
|
38
|
+
* wizard while Ink already owns stdin in raw mode, which is exactly the
|
|
39
|
+
* kind of two-consumers-fighting-over-stdin problem this project's
|
|
40
|
+
* `createInteractiveIO` fix (see CLAUDE.md) exists to avoid — simplest fix
|
|
41
|
+
* here is just not letting the two ever overlap in the first place.
|
|
42
|
+
*/
|
|
43
|
+
export declare function runTui(args: string[]): Promise<void>;
|
|
44
|
+
//# sourceMappingURL=App.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAW,MAAM,oBAAoB,CAAA;AAqE5D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,GAAG,CAAC,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,EAAE;IACD,eAAe,EAAE,OAAO,CAAA;IACxB,gBAAgB,EAAE,SAAS,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,+BA6jCA;AAED;;;;;;;;;GASG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B1D"}
|