@aisa-one/cli 0.3.0 → 0.5.1
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 +165 -1
- package/LICENSE +21 -0
- package/README.md +164 -170
- package/dist/api.d.ts +10 -0
- package/dist/api.js +14 -3
- package/dist/catalog.d.ts +1 -18
- package/dist/catalog.js +1 -24
- package/dist/cli-error.d.ts +17 -0
- package/dist/cli-error.js +25 -0
- package/dist/cli-guidance.d.ts +14 -0
- package/dist/cli-guidance.js +55 -0
- package/dist/commands/account.d.ts +17 -0
- package/dist/commands/account.js +45 -1
- package/dist/commands/api.d.ts +0 -11
- package/dist/commands/api.js +6 -175
- package/dist/commands/auth.d.ts +2 -1
- package/dist/commands/auth.js +45 -11
- package/dist/commands/brand-logos.d.ts +6 -0
- package/dist/commands/brand-logos.js +21 -0
- package/dist/commands/configCmd.js +8 -3
- package/dist/commands/connect-shared.d.ts +136 -0
- package/dist/commands/connect-shared.js +143 -0
- package/dist/commands/connect-t2.d.ts +18 -0
- package/dist/commands/connect-t2.js +1599 -0
- package/dist/commands/connect-terminal.d.ts +65 -0
- package/dist/commands/connect-terminal.js +822 -0
- package/dist/commands/connect.d.ts +31 -0
- package/dist/commands/connect.js +3181 -0
- package/dist/commands/flow.d.ts +685 -0
- package/dist/commands/flow.js +697 -0
- package/dist/commands/install.d.ts +91 -0
- package/dist/commands/install.js +258 -0
- package/dist/commands/llm-config.d.ts +103 -0
- package/dist/commands/llm-config.js +452 -0
- package/dist/commands/manifest.d.ts +68 -0
- package/dist/commands/manifest.js +90 -0
- package/dist/commands/mcp.d.ts +59 -0
- package/dist/commands/mcp.js +122 -44
- package/dist/commands/oauth-login.d.ts +33 -0
- package/dist/commands/oauth-login.js +333 -0
- package/dist/commands/prompt.d.ts +96 -0
- package/dist/commands/prompt.js +397 -0
- package/dist/commands/serve-results.d.ts +61 -0
- package/dist/commands/serve-results.js +245 -0
- package/dist/commands/serve-signin.d.ts +28 -0
- package/dist/commands/serve-signin.js +90 -0
- package/dist/commands/signin-page.d.ts +49 -0
- package/dist/commands/signin-page.js +250 -0
- package/dist/commands/skills.js +87 -50
- package/dist/commands/tool-help.d.ts +69 -0
- package/dist/commands/tool-help.js +189 -0
- package/dist/commands/tool-input.d.ts +22 -0
- package/dist/commands/tool-input.js +220 -0
- package/dist/commands/tools.d.ts +12 -0
- package/dist/commands/tools.js +306 -0
- package/dist/commands/update.d.ts +11 -0
- package/dist/commands/update.js +92 -0
- package/dist/commands/vscode.d.ts +65 -0
- package/dist/commands/vscode.js +173 -0
- package/dist/commands/wrappers.d.ts +23 -0
- package/dist/commands/wrappers.js +102 -0
- package/dist/completion.js +3 -80
- package/dist/config.d.ts +3 -0
- package/dist/config.js +80 -3
- package/dist/constants.d.ts +51 -38
- package/dist/constants.js +53 -109
- package/dist/index.js +152 -355
- package/dist/json-text.d.ts +12 -0
- package/dist/json-text.js +60 -0
- package/dist/router.d.ts +39 -0
- package/dist/router.js +59 -0
- package/dist/skills-registry.js +12 -3
- package/dist/utils/banner.d.ts +9 -0
- package/dist/utils/banner.js +41 -0
- package/dist/utils/browser.d.ts +19 -0
- package/dist/utils/browser.js +31 -0
- package/dist/utils/exec.d.ts +43 -0
- package/dist/utils/exec.js +61 -0
- package/dist/utils/http.d.ts +53 -0
- package/dist/utils/http.js +124 -0
- package/dist/utils/install-method.d.ts +36 -0
- package/dist/utils/install-method.js +48 -0
- package/dist/utils/journal.d.ts +57 -0
- package/dist/utils/journal.js +188 -0
- package/dist/utils/key-check.d.ts +20 -0
- package/dist/utils/key-check.js +24 -0
- package/dist/utils/update-check.d.ts +23 -0
- package/dist/utils/update-check.js +116 -0
- package/dist/utils/width.d.ts +32 -0
- package/dist/utils/width.js +73 -0
- package/package.json +8 -4
- package/vscode-extension/README.md +6 -0
- package/vscode-extension/aisa-vscode.vsix +0 -0
- package/dist/commands/finance.d.ts +0 -17
- package/dist/commands/finance.js +0 -342
- package/dist/commands/run.d.ts +0 -28
- package/dist/commands/run.js +0 -182
- package/dist/commands/search.d.ts +0 -9
- package/dist/commands/search.js +0 -81
- package/dist/commands/twitter.d.ts +0 -138
- package/dist/commands/twitter.js +0 -374
- package/dist/commands/video.d.ts +0 -49
- package/dist/commands/video.js +0 -311
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type Lang } from "./flow.js";
|
|
2
|
+
import type { ClientInfo, Selection } from "./connect-shared.js";
|
|
3
|
+
import type { LiveServer } from "./mcp.js";
|
|
4
|
+
import { cells } from "../utils/width.js";
|
|
5
|
+
/** A client as the flow sees it: detection plus whether we could install it. */
|
|
6
|
+
export interface FlowClient extends ClientInfo {
|
|
7
|
+
installable: boolean;
|
|
8
|
+
command?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Same rule the page applies, so both offer the same rows. */
|
|
11
|
+
export declare function flowClients(clients: ClientInfo[], canInstall: boolean): FlowClient[];
|
|
12
|
+
/**
|
|
13
|
+
* The connect flow, rendered in the terminal.
|
|
14
|
+
*
|
|
15
|
+
* Not a fallback for the page — the same flow, drawn differently. Every
|
|
16
|
+
* question, option and sentence comes from flow.ts, which is also what the
|
|
17
|
+
* page renders, so the two cannot describe the same choice in different
|
|
18
|
+
* words. A menu numbered here matches the card order there because both sort
|
|
19
|
+
* by `agentRank`.
|
|
20
|
+
*
|
|
21
|
+
* Two reasons this exists rather than "open the page":
|
|
22
|
+
*
|
|
23
|
+
* · A machine with no browser. Linux without a desktop, an SSH session, a
|
|
24
|
+
* container — where printing a localhost URL is not an offer, it is a
|
|
25
|
+
* dead end.
|
|
26
|
+
* · A browser that did not work. The page failing to open used to end the
|
|
27
|
+
* run; now it drops through to here.
|
|
28
|
+
*
|
|
29
|
+
* ── Staying in step with the page ─────────────────────────────────────────
|
|
30
|
+
* Both surfaces read and write one draft on the server (RunState.draft).
|
|
31
|
+
* Answering here POSTs the choice, so a page open at the same time shows it;
|
|
32
|
+
* between questions this polls, so a choice made in the page appears here.
|
|
33
|
+
* Neither is the master.
|
|
34
|
+
*/
|
|
35
|
+
export interface TerminalFlowOptions {
|
|
36
|
+
baseUrl: string;
|
|
37
|
+
token: string;
|
|
38
|
+
lang: Lang;
|
|
39
|
+
servers: LiveServer[];
|
|
40
|
+
clients: FlowClient[];
|
|
41
|
+
/** Set when this is the only surface — no page was opened. */
|
|
42
|
+
headless: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** Strip the markup the page needs and the terminal cannot show. */
|
|
45
|
+
export declare function plain(html: string): string;
|
|
46
|
+
/** Two columns wide in a terminal: CJK, and the punctuation that comes with it. */
|
|
47
|
+
/** Kept as a name because wrap() reads better with it; the maths is shared. */
|
|
48
|
+
export declare const displayWidth: typeof cells;
|
|
49
|
+
/**
|
|
50
|
+
* Wrap to the terminal width.
|
|
51
|
+
*
|
|
52
|
+
* Splitting on spaces alone is wrong for Chinese, which has none: a whole
|
|
53
|
+
* sentence arrives as one "word" and the line runs far past the margin —
|
|
54
|
+
* observed on the welcome step, where a paragraph overflowed by half a line.
|
|
55
|
+
* So a run that is itself too wide is broken between characters, and width is
|
|
56
|
+
* measured in cells rather than characters because CJK glyphs take two.
|
|
57
|
+
*/
|
|
58
|
+
export declare function wrap(text: string, width?: number): string[];
|
|
59
|
+
/**
|
|
60
|
+
* Walk the flow in the terminal and return what was chosen.
|
|
61
|
+
*
|
|
62
|
+
* Returns undefined when the user abandons it, which the caller treats the
|
|
63
|
+
* same way as closing the page.
|
|
64
|
+
*/
|
|
65
|
+
export declare function runTerminalFlow(o: TerminalFlowOptions): Promise<Selection | undefined>;
|