@akon-labs/nexus-cli 0.1.2 → 0.1.4
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/CHANGELOG.md +16 -5316
- package/README.md +30 -26
- package/dist/cli.js +90 -62
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +18 -63
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/extensions/gitnexus/gateway.d.ts +2 -0
- package/dist/extensions/gitnexus/gateway.d.ts.map +1 -1
- package/dist/extensions/gitnexus/gateway.js +22 -4
- package/dist/extensions/gitnexus/gateway.js.map +1 -1
- package/dist/extensions/gitnexus/index.d.ts.map +1 -1
- package/dist/extensions/gitnexus/index.js +21 -3
- package/dist/extensions/gitnexus/index.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js +1 -1
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/web-access.d.ts +8 -1
- package/dist/extensions/web-access.d.ts.map +1 -1
- package/dist/extensions/web-access.js +48 -2
- package/dist/extensions/web-access.js.map +1 -1
- package/dist/index.js +93 -65
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/migrations.js.map +1 -1
- package/dist/rpc-entry.js +90 -62
- package/dist/vendor/agent-core.js +6805 -0
- package/dist/vendor/ai.js +12407 -0
- package/dist/vendor/tui.js +11645 -0
- package/dist/vendor/web-access.js +93103 -0
- package/docs/compaction.md +14 -14
- package/docs/containerization.md +1 -1
- package/docs/custom-provider.md +17 -17
- package/docs/development.md +2 -2
- package/docs/environment-variables.md +1 -1
- package/docs/extensions.md +44 -44
- package/docs/index.md +5 -11
- package/docs/json.md +4 -4
- package/docs/llama-cpp.md +2 -2
- package/docs/models.md +3 -3
- package/docs/packages.md +6 -6
- package/docs/providers.md +13 -13
- package/docs/quickstart.md +19 -13
- package/docs/rpc.md +1 -1
- package/docs/sdk.md +28 -28
- package/docs/security.md +1 -1
- package/docs/session-format.md +6 -6
- package/docs/settings.md +1 -1
- package/docs/termux.md +1 -1
- package/docs/themes.md +2 -2
- package/docs/tui.md +20 -20
- package/docs/usage.md +5 -4
- package/examples/extensions/README.md +2 -2
- package/examples/extensions/auto-commit-on-exit.ts +1 -1
- package/examples/extensions/bash-spawn-hook.ts +2 -2
- package/examples/extensions/bookmark.ts +1 -1
- package/examples/extensions/border-status-editor.ts +3 -3
- package/examples/extensions/built-in-tool-renderer.ts +3 -3
- package/examples/extensions/claude-rules.ts +1 -1
- package/examples/extensions/commands.ts +1 -1
- package/examples/extensions/confirm-destructive.ts +1 -1
- package/examples/extensions/custom-compaction.ts +3 -3
- package/examples/extensions/custom-footer.ts +3 -3
- package/examples/extensions/custom-header.ts +2 -2
- package/examples/extensions/custom-provider-anthropic/index.ts +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
- package/examples/extensions/dirty-repo-guard.ts +1 -1
- package/examples/extensions/doom-overlay/doom-component.ts +2 -2
- package/examples/extensions/doom-overlay/doom-keys.ts +1 -1
- package/examples/extensions/doom-overlay/index.ts +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/dynamic-resources/index.ts +1 -1
- package/examples/extensions/dynamic-tools.ts +1 -1
- package/examples/extensions/entry-renderer.ts +2 -2
- package/examples/extensions/event-bus.ts +1 -1
- package/examples/extensions/file-trigger.ts +1 -1
- package/examples/extensions/git-checkpoint.ts +1 -1
- package/examples/extensions/git-merge-and-resolve.ts +1 -1
- package/examples/extensions/github-issue-autocomplete.ts +2 -2
- package/examples/extensions/gondolin/index.ts +2 -2
- package/examples/extensions/handoff.ts +4 -4
- package/examples/extensions/hello.ts +2 -2
- package/examples/extensions/hidden-thinking-label.ts +1 -1
- package/examples/extensions/inline-bash.ts +1 -1
- package/examples/extensions/input-transform-streaming.ts +1 -1
- package/examples/extensions/input-transform.ts +1 -1
- package/examples/extensions/interactive-shell.ts +1 -1
- package/examples/extensions/kimi-deferred-tools.ts +1 -1
- package/examples/extensions/mac-system-theme.ts +1 -1
- package/examples/extensions/message-renderer.ts +2 -2
- package/examples/extensions/minimal-mode.ts +3 -3
- package/examples/extensions/modal-editor.ts +2 -2
- package/examples/extensions/model-status.ts +1 -1
- package/examples/extensions/notify.ts +1 -1
- package/examples/extensions/overlay-qa-tests.ts +5 -5
- package/examples/extensions/overlay-test.ts +2 -2
- package/examples/extensions/permission-gate.ts +1 -1
- package/examples/extensions/pirate.ts +1 -1
- package/examples/extensions/plan-mode/index.ts +4 -4
- package/examples/extensions/preset.ts +4 -4
- package/examples/extensions/project-trust.ts +1 -1
- package/examples/extensions/prompt-customizer.ts +1 -1
- package/examples/extensions/protected-paths.ts +1 -1
- package/examples/extensions/provider-payload.ts +1 -1
- package/examples/extensions/qna.ts +3 -3
- package/examples/extensions/question.ts +2 -2
- package/examples/extensions/questionnaire.ts +2 -2
- package/examples/extensions/rainbow-editor.ts +1 -1
- package/examples/extensions/reload-runtime.ts +1 -1
- package/examples/extensions/rpc-demo.ts +1 -1
- package/examples/extensions/sandbox/index.ts +2 -2
- package/examples/extensions/send-user-message.ts +1 -1
- package/examples/extensions/session-name.ts +1 -1
- package/examples/extensions/shutdown-command.ts +1 -1
- package/examples/extensions/snake.ts +2 -2
- package/examples/extensions/space-invaders.ts +2 -2
- package/examples/extensions/ssh.ts +2 -2
- package/examples/extensions/status-line.ts +1 -1
- package/examples/extensions/structured-output.ts +2 -2
- package/examples/extensions/subagent/agents.ts +1 -1
- package/examples/extensions/subagent/index.ts +5 -5
- package/examples/extensions/summarize.ts +4 -4
- package/examples/extensions/system-prompt-header.ts +1 -1
- package/examples/extensions/tic-tac-toe.ts +3 -3
- package/examples/extensions/timed-confirm.ts +1 -1
- package/examples/extensions/titlebar-spinner.ts +1 -1
- package/examples/extensions/todo.ts +3 -3
- package/examples/extensions/tool-override.ts +2 -2
- package/examples/extensions/tools.ts +3 -3
- package/examples/extensions/trigger-compact.ts +1 -1
- package/examples/extensions/truncated-tool.ts +3 -3
- package/examples/extensions/widget-placement.ts +1 -1
- package/examples/extensions/with-deps/index.ts +1 -1
- package/examples/extensions/working-indicator.ts +1 -1
- package/examples/extensions/working-message-test.ts +1 -1
- package/examples/rpc-extension-ui.ts +1 -1
- package/examples/sdk/01-minimal.ts +1 -1
- package/examples/sdk/02-custom-model.ts +1 -1
- package/examples/sdk/03-custom-prompt.ts +1 -6
- package/examples/sdk/04-skills.ts +1 -1
- package/examples/sdk/05-tools.ts +1 -1
- package/examples/sdk/06-extensions.ts +2 -7
- package/examples/sdk/07-context-files.ts +1 -6
- package/examples/sdk/08-prompt-templates.ts +1 -1
- package/examples/sdk/09-api-keys-and-oauth.ts +1 -1
- package/examples/sdk/10-settings.ts +1 -1
- package/examples/sdk/11-sessions.ts +1 -1
- package/examples/sdk/12-full-control.ts +2 -2
- package/examples/sdk/13-session-runtime.ts +1 -1
- package/examples/sdk/README.md +2 -2
- package/npm-shrinkwrap.json +2 -26
- package/package.json +10 -25
package/docs/tui.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
|
|
6
6
|
|
|
7
|
-
**Source:** [`@
|
|
7
|
+
**Source:** [`@akon-labs/nexus-cli/tui`](https://github.com/Akon-Labs/nexus-cli/tree/main/packages/tui)
|
|
8
8
|
|
|
9
9
|
## Component Interface
|
|
10
10
|
|
|
@@ -33,7 +33,7 @@ The TUI appends a full SGR reset and OSC 8 reset at the end of each rendered lin
|
|
|
33
33
|
Components that display a text cursor and need IME (Input Method Editor) support should implement the `Focusable` interface:
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import { CURSOR_MARKER, type Component, type Focusable } from "@
|
|
36
|
+
import { CURSOR_MARKER, type Component, type Focusable } from "@akon-labs/nexus-cli/tui";
|
|
37
37
|
|
|
38
38
|
class MyInput implements Component, Focusable {
|
|
39
39
|
focused: boolean = false; // Set by TUI when focus changes
|
|
@@ -59,7 +59,7 @@ The cursor remains hidden by default. This keeps the fake cursor rendering, whil
|
|
|
59
59
|
When a container component (dialog, selector, etc.) contains an `Input` or `Editor` child, the container must implement `Focusable` and propagate the focus state to the child. Otherwise, the hardware cursor won't be positioned correctly for IME input.
|
|
60
60
|
|
|
61
61
|
```typescript
|
|
62
|
-
import { Container, type Focusable, Input } from "@
|
|
62
|
+
import { Container, type Focusable, Input } from "@akon-labs/nexus-cli/tui";
|
|
63
63
|
|
|
64
64
|
class SearchDialog extends Container implements Focusable {
|
|
65
65
|
private searchInput: Input;
|
|
@@ -201,10 +201,10 @@ See [overlay-qa-tests.ts](../examples/extensions/overlay-qa-tests.ts) for compre
|
|
|
201
201
|
|
|
202
202
|
## Built-in Components
|
|
203
203
|
|
|
204
|
-
Import from `@
|
|
204
|
+
Import from `@akon-labs/nexus-cli/tui`:
|
|
205
205
|
|
|
206
206
|
```typescript
|
|
207
|
-
import { Text, Box, Container, Spacer, Markdown } from "@
|
|
207
|
+
import { Text, Box, Container, Spacer, Markdown } from "@akon-labs/nexus-cli/tui";
|
|
208
208
|
```
|
|
209
209
|
|
|
210
210
|
### Text
|
|
@@ -286,7 +286,7 @@ const image = new Image(
|
|
|
286
286
|
Use `matchesKey()` for key detection:
|
|
287
287
|
|
|
288
288
|
```typescript
|
|
289
|
-
import { matchesKey, Key } from "@
|
|
289
|
+
import { matchesKey, Key } from "@akon-labs/nexus-cli/tui";
|
|
290
290
|
|
|
291
291
|
handleInput(data: string) {
|
|
292
292
|
if (matchesKey(data, Key.up)) {
|
|
@@ -312,7 +312,7 @@ handleInput(data: string) {
|
|
|
312
312
|
**Critical:** Each line from `render()` must not exceed the `width` parameter.
|
|
313
313
|
|
|
314
314
|
```typescript
|
|
315
|
-
import { visibleWidth, truncateToWidth } from "@
|
|
315
|
+
import { visibleWidth, truncateToWidth } from "@akon-labs/nexus-cli/tui";
|
|
316
316
|
|
|
317
317
|
render(width: number): string[] {
|
|
318
318
|
// Truncate long lines
|
|
@@ -333,7 +333,7 @@ Example: Interactive selector
|
|
|
333
333
|
import {
|
|
334
334
|
matchesKey, Key,
|
|
335
335
|
truncateToWidth, visibleWidth
|
|
336
|
-
} from "@
|
|
336
|
+
} from "@akon-labs/nexus-cli/tui";
|
|
337
337
|
|
|
338
338
|
class MySelector {
|
|
339
339
|
private items: string[];
|
|
@@ -449,8 +449,8 @@ renderResult(result, options, theme, context) {
|
|
|
449
449
|
**For Markdown**, use `getMarkdownTheme()`:
|
|
450
450
|
|
|
451
451
|
```typescript
|
|
452
|
-
import { getMarkdownTheme } from "@
|
|
453
|
-
import { Markdown } from "@
|
|
452
|
+
import { getMarkdownTheme } from "@akon-labs/nexus-cli";
|
|
453
|
+
import { Markdown } from "@akon-labs/nexus-cli/tui";
|
|
454
454
|
|
|
455
455
|
renderResult(result, options, theme, context) {
|
|
456
456
|
const mdTheme = getMarkdownTheme();
|
|
@@ -611,12 +611,12 @@ These patterns cover the most common UI needs in extensions. **Copy these patter
|
|
|
611
611
|
|
|
612
612
|
### Pattern 1: Selection Dialog (SelectList)
|
|
613
613
|
|
|
614
|
-
For letting users pick from a list of options. Use `SelectList` from `@
|
|
614
|
+
For letting users pick from a list of options. Use `SelectList` from `@akon-labs/nexus-cli/tui` with `DynamicBorder` for framing.
|
|
615
615
|
|
|
616
616
|
```typescript
|
|
617
|
-
import type { ExtensionAPI } from "@
|
|
618
|
-
import { DynamicBorder } from "@
|
|
619
|
-
import { Container, type SelectItem, SelectList, Text } from "@
|
|
617
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
618
|
+
import { DynamicBorder } from "@akon-labs/nexus-cli";
|
|
619
|
+
import { Container, type SelectItem, SelectList, Text } from "@akon-labs/nexus-cli/tui";
|
|
620
620
|
|
|
621
621
|
nexus.registerCommand("pick", {
|
|
622
622
|
handler: async (_args, ctx) => {
|
|
@@ -674,7 +674,7 @@ nexus.registerCommand("pick", {
|
|
|
674
674
|
For operations that take time and should be cancellable. `BorderedLoader` shows a spinner and handles escape to cancel.
|
|
675
675
|
|
|
676
676
|
```typescript
|
|
677
|
-
import { BorderedLoader } from "@
|
|
677
|
+
import { BorderedLoader } from "@akon-labs/nexus-cli";
|
|
678
678
|
|
|
679
679
|
nexus.registerCommand("fetch", {
|
|
680
680
|
handler: async (_args, ctx) => {
|
|
@@ -703,11 +703,11 @@ nexus.registerCommand("fetch", {
|
|
|
703
703
|
|
|
704
704
|
### Pattern 3: Settings/Toggles (SettingsList)
|
|
705
705
|
|
|
706
|
-
For toggling multiple settings. Use `SettingsList` from `@
|
|
706
|
+
For toggling multiple settings. Use `SettingsList` from `@akon-labs/nexus-cli/tui` with `getSettingsListTheme()`.
|
|
707
707
|
|
|
708
708
|
```typescript
|
|
709
|
-
import { getSettingsListTheme } from "@
|
|
710
|
-
import { Container, type SettingItem, SettingsList, Text } from "@
|
|
709
|
+
import { getSettingsListTheme } from "@akon-labs/nexus-cli";
|
|
710
|
+
import { Container, type SettingItem, SettingsList, Text } from "@akon-labs/nexus-cli/tui";
|
|
711
711
|
|
|
712
712
|
nexus.registerCommand("settings", {
|
|
713
713
|
handler: async (_args, ctx) => {
|
|
@@ -846,8 +846,8 @@ Token stats available via `ctx.sessionManager.getBranch()` and `ctx.model`.
|
|
|
846
846
|
Replace the main input editor with a custom implementation. Useful for modal editing (vim), different keybindings (emacs), or specialized input handling.
|
|
847
847
|
|
|
848
848
|
```typescript
|
|
849
|
-
import { CustomEditor, type ExtensionAPI } from "@
|
|
850
|
-
import { matchesKey, truncateToWidth } from "@
|
|
849
|
+
import { CustomEditor, type ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
850
|
+
import { matchesKey, truncateToWidth } from "@akon-labs/nexus-cli/tui";
|
|
851
851
|
|
|
852
852
|
type Mode = "normal" | "insert";
|
|
853
853
|
|
package/docs/usage.md
CHANGED
|
@@ -36,7 +36,10 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
36
36
|
|
|
37
37
|
| Command | Description |
|
|
38
38
|
|---------|-------------|
|
|
39
|
-
| `/login
|
|
39
|
+
| `/login` | Sign in to GitNexus |
|
|
40
|
+
| `/byok [provider\|ollama]` | Configure a cloud provider, API key, or local Ollama model |
|
|
41
|
+
| `/logout` | Remove stored model-provider credentials |
|
|
42
|
+
| `/gitnexus-status` | Show the GitNexus connection status |
|
|
40
43
|
| [`/llama`](llama-cpp.md) | Download, load, and unload llama.cpp router models |
|
|
41
44
|
| `/model` | Switch models |
|
|
42
45
|
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
@@ -56,7 +59,6 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
56
59
|
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
57
60
|
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
58
61
|
| `/hotkeys` | Show all keyboard shortcuts |
|
|
59
|
-
| `/changelog` | Display version history |
|
|
60
62
|
| `/quit` | Quit nexus |
|
|
61
63
|
|
|
62
64
|
## Message Queue
|
|
@@ -300,6 +302,5 @@ nexus --exclude-tools ask_question
|
|
|
300
302
|
|
|
301
303
|
Nexus keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
|
|
302
304
|
|
|
303
|
-
It
|
|
305
|
+
It includes a built-in MCP adapter, but intentionally leaves sub-agents, permission popups, plan mode, to-dos, and background bash to extensions, packages, containers, or external tools such as tmux.
|
|
304
306
|
|
|
305
|
-
For the full rationale, read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/).
|
|
@@ -142,7 +142,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
|
|
|
142
142
|
See [docs/extensions.md](../../docs/extensions.md) for full documentation.
|
|
143
143
|
|
|
144
144
|
```typescript
|
|
145
|
-
import type { ExtensionAPI } from "@
|
|
145
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
146
146
|
import { Type } from "typebox";
|
|
147
147
|
|
|
148
148
|
export default function (pi: ExtensionAPI) {
|
|
@@ -184,7 +184,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
184
184
|
|
|
185
185
|
**Use StringEnum for string parameters** (required for Google API compatibility):
|
|
186
186
|
```typescript
|
|
187
|
-
import { StringEnum } from "@
|
|
187
|
+
import { StringEnum } from "@akon-labs/nexus-cli/ai";
|
|
188
188
|
|
|
189
189
|
// Good
|
|
190
190
|
action: StringEnum(["list", "add"] as const)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Uses the last assistant message to generate a commit message.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI } from "@
|
|
8
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
9
9
|
|
|
10
10
|
export default function (pi: ExtensionAPI) {
|
|
11
11
|
pi.on("session_shutdown", async (_event, ctx) => {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* pi -e ./bash-spawn-hook.ts
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ExtensionAPI } from "@
|
|
11
|
-
import { createBashTool } from "@
|
|
10
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
11
|
+
import { createBashTool } from "@akon-labs/nexus-cli";
|
|
12
12
|
|
|
13
13
|
export default function (pi: ExtensionAPI) {
|
|
14
14
|
const cwd = process.cwd();
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Usage: /bookmark [label] - bookmark the last assistant message
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ExtensionAPI } from "@
|
|
10
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
11
11
|
|
|
12
12
|
export default function (pi: ExtensionAPI) {
|
|
13
13
|
pi.registerCommand("bookmark", {
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
type ExtensionAPI,
|
|
4
4
|
type ExtensionContext,
|
|
5
5
|
type KeybindingsManager,
|
|
6
|
-
} from "@
|
|
7
|
-
import type { Component, EditorTheme, TUI } from "@
|
|
8
|
-
import { truncateToWidth, visibleWidth } from "@
|
|
6
|
+
} from "@akon-labs/nexus-cli";
|
|
7
|
+
import type { Component, EditorTheme, TUI } from "@akon-labs/nexus-cli/tui";
|
|
8
|
+
import { truncateToWidth, visibleWidth } from "@akon-labs/nexus-cli/tui";
|
|
9
9
|
|
|
10
10
|
function fitBorder(
|
|
11
11
|
left: string,
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
* pi -e ./built-in-tool-renderer.ts
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import type { BashToolDetails, EditToolDetails, ExtensionAPI, ReadToolDetails } from "@
|
|
29
|
-
import { createBashTool, createEditTool, createReadTool, createWriteTool } from "@
|
|
30
|
-
import { Text } from "@
|
|
28
|
+
import type { BashToolDetails, EditToolDetails, ExtensionAPI, ReadToolDetails } from "@akon-labs/nexus-cli";
|
|
29
|
+
import { createBashTool, createEditTool, createReadTool, createWriteTool } from "@akon-labs/nexus-cli";
|
|
30
|
+
import { Text } from "@akon-labs/nexus-cli/tui";
|
|
31
31
|
|
|
32
32
|
export default function (pi: ExtensionAPI) {
|
|
33
33
|
const cwd = process.cwd();
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
import * as fs from "node:fs";
|
|
21
21
|
import * as path from "node:path";
|
|
22
|
-
import type { ExtensionAPI } from "@
|
|
22
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Recursively find all .md files in a directory
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* 3. Use /commands extensions to filter by source
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type { ExtensionAPI, SlashCommandInfo } from "@
|
|
13
|
+
import type { ExtensionAPI, SlashCommandInfo } from "@akon-labs/nexus-cli";
|
|
14
14
|
|
|
15
15
|
export default function commandsExtension(pi: ExtensionAPI) {
|
|
16
16
|
pi.registerCommand("commands", {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Demonstrates how to cancel session events using the before_* events.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI, SessionBeforeSwitchEvent, SessionMessageEntry } from "@
|
|
8
|
+
import type { ExtensionAPI, SessionBeforeSwitchEvent, SessionMessageEntry } from "@akon-labs/nexus-cli";
|
|
9
9
|
|
|
10
10
|
export default function (pi: ExtensionAPI) {
|
|
11
11
|
pi.on("session_before_switch", async (event: SessionBeforeSwitchEvent, ctx) => {
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* pi --extension examples/extensions/custom-compaction.ts
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { uuidv7 } from "@
|
|
17
|
-
import type { ExtensionAPI } from "@
|
|
18
|
-
import { convertToLlm, serializeConversation } from "@
|
|
16
|
+
import { uuidv7 } from "@akon-labs/nexus-cli/ai";
|
|
17
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
18
|
+
import { convertToLlm, serializeConversation } from "@akon-labs/nexus-cli";
|
|
19
19
|
|
|
20
20
|
export default function (pi: ExtensionAPI) {
|
|
21
21
|
pi.on("session_before_compact", async (event, ctx) => {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* Token stats come from ctx.sessionManager/ctx.model (already accessible).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { AssistantMessage } from "@
|
|
12
|
-
import type { ExtensionAPI } from "@
|
|
13
|
-
import { truncateToWidth, visibleWidth } from "@
|
|
11
|
+
import type { AssistantMessage } from "@akon-labs/nexus-cli/ai";
|
|
12
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
13
|
+
import { truncateToWidth, visibleWidth } from "@akon-labs/nexus-cli/tui";
|
|
14
14
|
|
|
15
15
|
export default function (pi: ExtensionAPI) {
|
|
16
16
|
let enabled = false;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* (logo + keybinding hints) with a custom component showing the pi mascot.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI, Theme } from "@
|
|
9
|
-
import { VERSION } from "@
|
|
8
|
+
import type { ExtensionAPI, Theme } from "@akon-labs/nexus-cli";
|
|
9
|
+
import { VERSION } from "@akon-labs/nexus-cli";
|
|
10
10
|
|
|
11
11
|
// --- PI MASCOT ---
|
|
12
12
|
// Based on pi_mascot.ts - the pi agent character
|
|
@@ -42,8 +42,8 @@ import {
|
|
|
42
42
|
type Tool,
|
|
43
43
|
type ToolCall,
|
|
44
44
|
type ToolResultMessage,
|
|
45
|
-
} from "@
|
|
46
|
-
import type { ExtensionAPI } from "@
|
|
45
|
+
} from "@akon-labs/nexus-cli/ai";
|
|
46
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
47
47
|
|
|
48
48
|
// =============================================================================
|
|
49
49
|
// OAuth implementation adapted for the legacy extension compatibility interface.
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
openAIResponsesApi,
|
|
22
22
|
type SimpleStreamOptions,
|
|
23
23
|
type ThinkingLevelMap,
|
|
24
|
-
} from "@
|
|
25
|
-
import type { ExtensionAPI } from "@
|
|
24
|
+
} from "@akon-labs/nexus-cli/ai";
|
|
25
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
26
26
|
|
|
27
27
|
// =============================================================================
|
|
28
28
|
// Constants
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* npx tsx test.ts claude-sonnet-4-5-20250929 --thinking
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@
|
|
11
|
+
import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@akon-labs/nexus-cli/ai";
|
|
12
12
|
import { readFileSync } from "fs";
|
|
13
13
|
import { getAgentDir } from "packages/coding-agent/src/config.js";
|
|
14
14
|
import { join } from "path";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Useful to ensure work is committed before switching context.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI, ExtensionContext } from "@
|
|
8
|
+
import type { ExtensionAPI, ExtensionContext } from "@akon-labs/nexus-cli";
|
|
9
9
|
|
|
10
10
|
async function checkDirtyRepo(
|
|
11
11
|
pi: ExtensionAPI,
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Height is calculated from width to maintain DOOM's aspect ratio.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { Component } from "@
|
|
9
|
-
import { isKeyRelease, type TUI } from "@
|
|
8
|
+
import type { Component } from "@akon-labs/nexus-cli/tui";
|
|
9
|
+
import { isKeyRelease, type TUI } from "@akon-labs/nexus-cli/tui";
|
|
10
10
|
import type { DoomEngine } from "./doom-engine.ts";
|
|
11
11
|
import { DoomKeys, mapKeyToDoom } from "./doom-keys.ts";
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ export const DoomKeys = {
|
|
|
34
34
|
KEY_RALT: 0x80 + 0x38,
|
|
35
35
|
} as const;
|
|
36
36
|
|
|
37
|
-
import { Key, matchesKey, parseKey } from "@
|
|
37
|
+
import { Key, matchesKey, parseKey } from "@akon-labs/nexus-cli/tui";
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Map terminal key input to DOOM key codes
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* This demonstrates that overlays can handle real-time game rendering at 35 FPS.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type { ExtensionAPI } from "@
|
|
12
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
13
13
|
import { DoomOverlayComponent } from "./doom-component.ts";
|
|
14
14
|
import { DoomEngine } from "./doom-engine.ts";
|
|
15
15
|
import { ensureWadFile } from "./wad-finder.ts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/Akon-Labs/nexus-cli/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
3
|
"name": "dynamic-resources",
|
|
4
4
|
"vars": {
|
|
5
5
|
"cyan": "#00d7ff",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dirname, join } from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import type { ExtensionAPI } from "@
|
|
3
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
4
4
|
|
|
5
5
|
const baseDir = dirname(fileURLToPath(import.meta.url));
|
|
6
6
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - Registers additional tools at runtime via /add-echo-tool <name>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ExtensionAPI } from "@
|
|
10
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
11
11
|
import { Type } from "typebox";
|
|
12
12
|
|
|
13
13
|
const ECHO_PARAMS = Type.Object({
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* Usage: /status-card [message]
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { ExtensionAPI } from "@
|
|
12
|
-
import { Box, Text } from "@
|
|
11
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
12
|
+
import { Box, Text } from "@akon-labs/nexus-cli/tui";
|
|
13
13
|
|
|
14
14
|
interface StatusCardData {
|
|
15
15
|
message: string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Usage: /emit [event-name] [data] - emit an event on the bus
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ExtensionAPI, ExtensionContext } from "@
|
|
10
|
+
import type { ExtensionAPI, ExtensionContext } from "@akon-labs/nexus-cli";
|
|
11
11
|
|
|
12
12
|
export default function (pi: ExtensionAPI) {
|
|
13
13
|
// Store ctx for use in event handler
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import * as fs from "node:fs";
|
|
12
|
-
import type { ExtensionAPI } from "@
|
|
12
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
13
13
|
|
|
14
14
|
export default function (pi: ExtensionAPI) {
|
|
15
15
|
pi.on("session_start", async (_event, ctx) => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* When forking, offers to restore code to that point in history.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI } from "@
|
|
8
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
9
9
|
|
|
10
10
|
export default function (pi: ExtensionAPI) {
|
|
11
11
|
const checkpoints = new Map<string, string>();
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { createReadStream } from "node:fs";
|
|
15
15
|
import { join } from "node:path";
|
|
16
16
|
import { createInterface } from "node:readline";
|
|
17
|
-
import type { ExtensionAPI } from "@
|
|
17
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
18
18
|
|
|
19
19
|
interface ConflictBlock {
|
|
20
20
|
file: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Requires GitHub CLI (`gh`) and a GitHub repository checkout.
|
|
2
2
|
// Preloads the latest open issues once per session, then filters them locally for fast `#...` completion.
|
|
3
3
|
|
|
4
|
-
import type { ExtensionAPI } from "@
|
|
4
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
5
5
|
import {
|
|
6
6
|
type AutocompleteItem,
|
|
7
7
|
type AutocompleteProvider,
|
|
8
8
|
type AutocompleteSuggestions,
|
|
9
9
|
fuzzyFilter,
|
|
10
|
-
} from "@
|
|
10
|
+
} from "@akon-labs/nexus-cli/tui";
|
|
11
11
|
|
|
12
12
|
type GitHubIssue = {
|
|
13
13
|
number: number;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
import path from "node:path";
|
|
23
23
|
import { RealFSProvider, VM } from "@earendil-works/gondolin";
|
|
24
|
-
import type { ExtensionAPI, ExtensionContext } from "@
|
|
24
|
+
import type { ExtensionAPI, ExtensionContext } from "@akon-labs/nexus-cli";
|
|
25
25
|
import {
|
|
26
26
|
type BashOperations,
|
|
27
27
|
createBashTool,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
truncateHead,
|
|
43
43
|
truncateLine,
|
|
44
44
|
type WriteOperations,
|
|
45
|
-
} from "@
|
|
45
|
+
} from "@akon-labs/nexus-cli";
|
|
46
46
|
|
|
47
47
|
const GUEST_WORKSPACE = "/workspace";
|
|
48
48
|
const DEFAULT_GREP_LIMIT = 100;
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* The generated prompt appears as a draft in the editor for review/editing.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import type { AgentMessage } from "@
|
|
16
|
-
import { type Message, uuidv7 } from "@
|
|
17
|
-
import type { ExtensionAPI, SessionEntry } from "@
|
|
18
|
-
import { BorderedLoader, convertToLlm, serializeConversation } from "@
|
|
15
|
+
import type { AgentMessage } from "@akon-labs/nexus-cli/agent-core";
|
|
16
|
+
import { type Message, uuidv7 } from "@akon-labs/nexus-cli/ai";
|
|
17
|
+
import type { ExtensionAPI, SessionEntry } from "@akon-labs/nexus-cli";
|
|
18
|
+
import { BorderedLoader, convertToLlm, serializeConversation } from "@akon-labs/nexus-cli";
|
|
19
19
|
|
|
20
20
|
const SYSTEM_PROMPT = `You are a context transfer assistant. Given a conversation history and the user's goal for a new thread, generate a focused prompt that:
|
|
21
21
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Hello Tool - Minimal custom tool example
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { Type } from "@
|
|
6
|
-
import { defineTool, type ExtensionAPI } from "@
|
|
5
|
+
import { Type } from "@akon-labs/nexus-cli/ai";
|
|
6
|
+
import { defineTool, type ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
7
7
|
|
|
8
8
|
const helloTool = defineTool({
|
|
9
9
|
name: "hello",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* /thinking-label Reset to the default label
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import type { ExtensionAPI, ExtensionContext } from "@
|
|
21
|
+
import type { ExtensionAPI, ExtensionContext } from "@akon-labs/nexus-cli";
|
|
22
22
|
|
|
23
23
|
const DEFAULT_LABEL = "Pondering...";
|
|
24
24
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Note: Regular !command syntax (whole-line bash) is preserved and works as before.
|
|
16
16
|
*/
|
|
17
|
-
import type { ExtensionAPI } from "@
|
|
17
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
18
18
|
|
|
19
19
|
export default function (pi: ExtensionAPI) {
|
|
20
20
|
const PATTERN = /!\{([^}]+)\}/g;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Start pi with this extension:
|
|
12
12
|
* pi -e ./examples/extensions/input-transform-streaming.ts
|
|
13
13
|
*/
|
|
14
|
-
import type { ExtensionAPI } from "@
|
|
14
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
15
15
|
|
|
16
16
|
const TRIGGER = /\b(changes?|diff|modified)\b/i;
|
|
17
17
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* ping → "pong" (instant, no LLM)
|
|
10
10
|
* time → current time (instant, no LLM)
|
|
11
11
|
*/
|
|
12
|
-
import type { ExtensionAPI } from "@
|
|
12
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
13
13
|
|
|
14
14
|
export default function (pi: ExtensionAPI) {
|
|
15
15
|
pi.on("input", async (event, ctx) => {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { spawnSync } from "node:child_process";
|
|
24
|
-
import type { ExtensionAPI } from "@
|
|
24
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
25
25
|
|
|
26
26
|
// Default interactive commands - editors, pagers, git ops, TUIs
|
|
27
27
|
const DEFAULT_INTERACTIVE_COMMANDS = [
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* example prompt: Use the available tools to calculate 100 + 500. Do not calculate it yourself.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI } from "@
|
|
8
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
9
9
|
import { Type } from "typebox";
|
|
10
10
|
|
|
11
11
|
function calculate(_expr: string): string {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Usage: /status [message] - sends a status message with custom rendering
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ExtensionAPI } from "@
|
|
11
|
-
import { Box, Text } from "@
|
|
10
|
+
import type { ExtensionAPI } from "@akon-labs/nexus-cli";
|
|
11
|
+
import { Box, Text } from "@akon-labs/nexus-cli/tui";
|
|
12
12
|
|
|
13
13
|
export default function (pi: ExtensionAPI) {
|
|
14
14
|
// Register custom renderer for "status-update" messages
|