@copado/agentia-cli 0.117.0-alpha.0 → 0.119.0-alpha.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 +225 -294
- package/dist/commands/cicd/notification/configure.d.ts +1 -1
- package/dist/commands/cicd/work/deployment-step/create.d.ts +1 -1
- package/dist/commands/testing/build/run.d.ts +2 -2
- package/dist/commands/testing/data-table/create.d.ts +1 -1
- package/dist/commands/testing/data-table/update.d.ts +1 -1
- package/dist/commands/testing/job/create.d.ts +1 -1
- package/dist/commands/testing/job/schedule/set.d.ts +1 -1
- package/dist/commands/testing/job/update.d.ts +1 -1
- package/dist/commands/testing/robot/update.d.ts +1 -1
- package/dist/commands/testing/run.d.ts +2 -2
- package/dist/commands/testing/test/run.d.ts +2 -2
- package/dist/lib/ai-chat-session.d.ts +0 -3
- package/dist/lib/ai-chat-session.js +66 -182
- package/dist/lib/ai-chat-session.js.map +1 -1
- package/dist/lib/ai-gateway.d.ts +1 -8
- package/dist/lib/ai-gateway.js +2 -34
- package/dist/lib/ai-gateway.js.map +1 -1
- package/dist/lib/ai-types.d.ts +0 -18
- package/dist/lib/ai-types.js +1 -45
- package/dist/lib/ai-types.js.map +1 -1
- package/dist/lib/cicd-gateway.d.ts +1 -0
- package/dist/lib/cicd-gateway.js +14 -1
- package/dist/lib/cicd-gateway.js.map +1 -1
- package/dist/lib/format.d.ts +0 -2
- package/dist/lib/format.js +2 -5
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/mcp/tools.d.ts +2 -2
- package/dist/lib/testing-data-command.d.ts +1 -1
- package/dist/lib/testing-flags.d.ts +2 -2
- package/oclif.manifest.json +458 -609
- package/package.json +1 -10
- package/templates/skills/agentia-ai/SKILL.md +5 -5
- package/templates/skills/agentia-ai/references/ai-agents.md +3 -18
- package/dist/commands/ai/session/list.d.ts +0 -14
- package/dist/commands/ai/session/list.js +0 -46
- package/dist/commands/ai/session/list.js.map +0 -1
- package/dist/commands/ai/session/start.d.ts +0 -17
- package/dist/commands/ai/session/start.js +0 -60
- package/dist/commands/ai/session/start.js.map +0 -1
- package/dist/lib/ai-session-banner.d.ts +0 -5
- package/dist/lib/ai-session-banner.js +0 -20
- package/dist/lib/ai-session-banner.js.map +0 -1
- package/dist/lib/ai-session-tui-blocks.d.ts +0 -9
- package/dist/lib/ai-session-tui-blocks.js +0 -36
- package/dist/lib/ai-session-tui-blocks.js.map +0 -1
- package/dist/lib/ai-session-tui-clipboard.d.ts +0 -22
- package/dist/lib/ai-session-tui-clipboard.js +0 -78
- package/dist/lib/ai-session-tui-clipboard.js.map +0 -1
- package/dist/lib/ai-session-tui-composer.d.ts +0 -35
- package/dist/lib/ai-session-tui-composer.js +0 -96
- package/dist/lib/ai-session-tui-composer.js.map +0 -1
- package/dist/lib/ai-session-tui-highlight.d.ts +0 -11
- package/dist/lib/ai-session-tui-highlight.js +0 -310
- package/dist/lib/ai-session-tui-highlight.js.map +0 -1
- package/dist/lib/ai-session-tui-keys.d.ts +0 -42
- package/dist/lib/ai-session-tui-keys.js +0 -159
- package/dist/lib/ai-session-tui-keys.js.map +0 -1
- package/dist/lib/ai-session-tui-mermaid-image.d.ts +0 -43
- package/dist/lib/ai-session-tui-mermaid-image.js +0 -444
- package/dist/lib/ai-session-tui-mermaid-image.js.map +0 -1
- package/dist/lib/ai-session-tui-mermaid-paint.d.ts +0 -3
- package/dist/lib/ai-session-tui-mermaid-paint.js +0 -182
- package/dist/lib/ai-session-tui-mermaid-paint.js.map +0 -1
- package/dist/lib/ai-session-tui-mermaid.d.ts +0 -19
- package/dist/lib/ai-session-tui-mermaid.js +0 -158
- package/dist/lib/ai-session-tui-mermaid.js.map +0 -1
- package/dist/lib/ai-session-tui-message.d.ts +0 -9
- package/dist/lib/ai-session-tui-message.js +0 -24
- package/dist/lib/ai-session-tui-message.js.map +0 -1
- package/dist/lib/ai-session-tui-scroll.d.ts +0 -32
- package/dist/lib/ai-session-tui-scroll.js +0 -148
- package/dist/lib/ai-session-tui-scroll.js.map +0 -1
- package/dist/lib/ai-session-tui-slash.d.ts +0 -14
- package/dist/lib/ai-session-tui-slash.js +0 -53
- package/dist/lib/ai-session-tui-slash.js.map +0 -1
- package/dist/lib/ai-session-tui-welcome.d.ts +0 -12
- package/dist/lib/ai-session-tui-welcome.js +0 -33
- package/dist/lib/ai-session-tui-welcome.js.map +0 -1
- package/dist/lib/ai-session-tui-wrap.d.ts +0 -2
- package/dist/lib/ai-session-tui-wrap.js +0 -24
- package/dist/lib/ai-session-tui-wrap.js.map +0 -1
- package/dist/lib/ai-session-tui.d.ts +0 -7
- package/dist/lib/ai-session-tui.js +0 -859
- package/dist/lib/ai-session-tui.js.map +0 -1
- package/dist/lib/ai-sessions.d.ts +0 -17
- package/dist/lib/ai-sessions.js +0 -142
- package/dist/lib/ai-sessions.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copado/agentia-cli",
|
|
3
3
|
"description": "Command-line interface for Agentia",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.119.0-alpha.0",
|
|
5
5
|
"author": "Copado Solutions",
|
|
6
6
|
"bin": {
|
|
7
7
|
"agentia": "./bin/run.js"
|
|
@@ -14,12 +14,8 @@
|
|
|
14
14
|
"@oclif/core": "^4",
|
|
15
15
|
"@oclif/plugin-help": "^6",
|
|
16
16
|
"@oclif/plugin-plugins": "^5",
|
|
17
|
-
"@resvg/resvg-js": "^2.6.2",
|
|
18
17
|
"@xmldom/xmldom": "^0.9.12",
|
|
19
|
-
"beautiful-mermaid": "^1.1.3",
|
|
20
18
|
"exceljs": "^4.4.0",
|
|
21
|
-
"ink": "5.2.1",
|
|
22
|
-
"react": "18.3.1",
|
|
23
19
|
"semver": "^7.8.5",
|
|
24
20
|
"tty-table": "^5.0.0",
|
|
25
21
|
"uuid": "^14.0.1",
|
|
@@ -33,14 +29,12 @@
|
|
|
33
29
|
"@types/chai": "^4",
|
|
34
30
|
"@types/mocha": "^10",
|
|
35
31
|
"@types/node": "^18",
|
|
36
|
-
"@types/react": "18.3.18",
|
|
37
32
|
"@types/semver": "^7.8.0",
|
|
38
33
|
"@types/ws": "^8.18.1",
|
|
39
34
|
"chai": "^4",
|
|
40
35
|
"eslint": "^9",
|
|
41
36
|
"eslint-config-oclif": "^6",
|
|
42
37
|
"eslint-config-prettier": "^10",
|
|
43
|
-
"ink-testing-library": "4.0.0",
|
|
44
38
|
"mocha": "^11",
|
|
45
39
|
"oclif": "^4",
|
|
46
40
|
"shx": "^0.3.3",
|
|
@@ -92,9 +86,6 @@
|
|
|
92
86
|
"ai:quota": {
|
|
93
87
|
"description": "Inspect Copado AI quota"
|
|
94
88
|
},
|
|
95
|
-
"ai:session": {
|
|
96
|
-
"description": "List and resume Copado AI dialogue sessions"
|
|
97
|
-
},
|
|
98
89
|
"ai:workspace": {
|
|
99
90
|
"description": "Manage Copado AI workspaces"
|
|
100
91
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentia-ai
|
|
3
|
-
description: Use this skill when prompting Copado AI agents through the Agentia CLI or MCP, including `agentia ai agent ask`, `agentia ai agent chat`,
|
|
3
|
+
description: Use this skill when prompting Copado AI agents through the Agentia CLI or MCP, including `agentia ai agent ask`, `agentia ai agent chat`, Plan, Build, Test, Release, Operate, Knowledge, workspace, dialogue, user story, Salesforce org, and component context.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- Agentia managed skill file: agentia setup skills -->
|
|
@@ -9,14 +9,14 @@ description: Use this skill when prompting Copado AI agents through the Agentia
|
|
|
9
9
|
|
|
10
10
|
Use this skill to ask Copado AI agents through Agentia with the right agent selector, workspace context, and output mode.
|
|
11
11
|
|
|
12
|
-
Prefer the `agentia_ai_ask` MCP tool when it is available for single-turn prompts. Use CLI examples as the fallback. Use `agentia ai
|
|
12
|
+
Prefer the `agentia_ai_ask` MCP tool when it is available for single-turn prompts. Use CLI examples as the fallback. Use `agentia ai agent chat` only for interactive terminal sessions.
|
|
13
13
|
|
|
14
14
|
## Start Here
|
|
15
15
|
|
|
16
16
|
1. Confirm AI auth with `agentia auth get --ai --json`. Configure missing credentials with `agentia auth set --ai ...` or the supported `AGENTIA_AI_*` environment variables.
|
|
17
|
-
2. Choose exactly one agent selector for `ask`: `--plan`, `--build`, `--test`, `--release`, `--operate`, or `--knowledge`.
|
|
18
|
-
3. Add useful context flags when available: `--workspace
|
|
19
|
-
4. Use `--json` for automation. Use `--no-stream` when the caller needs a buffered response.
|
|
17
|
+
2. Choose exactly one agent selector for `ask`: `--plan`, `--build`, `--test`, `--release`, `--operate`, or `--knowledge`.
|
|
18
|
+
3. Add useful context flags when available: `--workspace`, `--dialogue`, `--user-story`, `--sf-org`, and `--component`.
|
|
19
|
+
4. Use `--json` for automation. Use `--no-stream` when the caller needs a buffered response.
|
|
20
20
|
|
|
21
21
|
## Reference
|
|
22
22
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# AI Agents Reference
|
|
4
4
|
|
|
5
|
-
Use this reference for `agentia ai agent ask`, `agentia ai agent chat`,
|
|
5
|
+
Use this reference for `agentia ai agent ask`, `agentia ai agent chat`, and the matching `agentia_ai_ask` MCP tool.
|
|
6
6
|
|
|
7
7
|
## Authentication And Context
|
|
8
8
|
|
|
@@ -52,20 +52,6 @@ agentia ai agent chat --orchestrate --workspace <workspace-id>
|
|
|
52
52
|
|
|
53
53
|
Chat creates or reuses one dialogue for the session and supports session slash commands. It is not suitable for headless JSON workflows.
|
|
54
54
|
|
|
55
|
-
## Sessions
|
|
56
|
-
|
|
57
|
-
Prefer `session list` and `session start` for human terminal use. A session is a Copado GPT Gateway dialogue (Context Hub). `--dialogue` is that UUID, same flag as `ask` / `chat`.
|
|
58
|
-
|
|
59
|
-
```sh
|
|
60
|
-
agentia ai session list
|
|
61
|
-
agentia ai session list --page-size 15 --workspace <workspace-id> --json
|
|
62
|
-
agentia ai session start
|
|
63
|
-
agentia ai session start --dialogue <dialogue-uuid>
|
|
64
|
-
agentia ai session start --agent build --user-story US-1042
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
`session list` defaults to 15 rows (max 200) from `GET /dialogues`, newest first. `session start` is TTY-only and opens an Ink session UI (header, wrapping scrolling transcript, sticky composer, syntax-colored fences, Mermaid diagrams as filled flowchart chips (diamond / stadium / rectangle), or a pixel PNG in Kitty). Type `/` for command autocomplete (Tab completes, Enter runs, Esc dismisses). Esc cancels an in-flight turn. `/clear` wipes the local transcript; `/new` starts a new dialogue after confirm; `/copy` copies the last fenced block without `│` gutters. Drag-select still copies the screen (mouse tracking is off so the terminal can select). ←/→ move the composer cursor; ↑/↓ scroll the transcript; PgUp/PgDn (Fn+↑ / Fn+↓ on a Mac) recall previous prompts. After a reply, numbered Follow-ups can be sent with 1–5 on an empty prompt. The terminal scrollbar is not the history. Without `--dialogue` it shows a CopadoContextHub welcome; `/session` (or Resume) opens an overlay picker. Agent slash commands stay on the current dialogue: `/plan`, `/build`, `/test`, `/release`, `/operate`, `/knowledge`, `/orchestrate`, plus `/help`, `/copy`, `/clear`, `/exit`. Esc or `/cancel` dismisses the overlay. `ai agent chat` still uses the readline loop. There is no MCP tool for list or start.
|
|
68
|
-
|
|
69
55
|
## Workspace And Quota Helpers
|
|
70
56
|
|
|
71
57
|
Use these adjacent commands when the prompt workflow needs context setup:
|
|
@@ -78,8 +64,7 @@ Use these adjacent commands when the prompt workflow needs context setup:
|
|
|
78
64
|
|
|
79
65
|
## Gotchas
|
|
80
66
|
|
|
81
|
-
- `--workspace`
|
|
82
|
-
- `--user-story`, `--sf-org`, and `--component`
|
|
67
|
+
- `--workspace` selects the workspace; `--dialogue` reuses a conversation inside that workspace.
|
|
68
|
+
- `--user-story`, `--sf-org`, and `--component` enrich prompt context but do not replace a clear prompt.
|
|
83
69
|
- Streaming is human-friendly. For tools, CI, or follow-up parsing, use `--json` and consider `--no-stream`.
|
|
84
70
|
- `chat` has no MCP equivalent and should not be used in non-interactive shells.
|
|
85
|
-
- `session start` also has no MCP equivalent. Use `session list --json` to inspect dialogue IDs from scripts.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
-
import { type AiDialogueSummary } from '../../../lib/ai-types.js';
|
|
3
|
-
import { type PaginatedListResult } from '../../../lib/list-pagination.js';
|
|
4
|
-
export default class AiSessionList extends AgentiaCommand {
|
|
5
|
-
static description: string;
|
|
6
|
-
static examples: string[];
|
|
7
|
-
static flags: {
|
|
8
|
-
'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
timeout: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
};
|
|
13
|
-
run(): Promise<PaginatedListResult<AiDialogueSummary>>;
|
|
14
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
|
-
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import { aiConnectionFlags, aiGatewayCallOptions } from '../../../lib/ai-flags.js';
|
|
4
|
-
import { formatAiSessionTable, listAiSessions } from '../../../lib/ai-sessions.js';
|
|
5
|
-
import { AI_SESSION_LIST_DEFAULT_PAGE_SIZE } from '../../../lib/ai-types.js';
|
|
6
|
-
import { displayListPagination, LIST_PAGE_SIZE_MAX, LIST_PAGE_SIZE_MIN, listPaginationFlags, } from '../../../lib/list-pagination.js';
|
|
7
|
-
export default class AiSessionList extends AgentiaCommand {
|
|
8
|
-
static description = 'List Copado AI dialogue sessions';
|
|
9
|
-
static examples = [
|
|
10
|
-
'<%= config.bin %> <%= command.id %>',
|
|
11
|
-
'<%= config.bin %> <%= command.id %> --page-size 15',
|
|
12
|
-
'<%= config.bin %> <%= command.id %> --workspace 42d0b908-37b7-4565-9ec9-86eda40c9782 --json',
|
|
13
|
-
];
|
|
14
|
-
static flags = {
|
|
15
|
-
...aiConnectionFlags,
|
|
16
|
-
...listPaginationFlags,
|
|
17
|
-
'page-size': Flags.integer({
|
|
18
|
-
default: AI_SESSION_LIST_DEFAULT_PAGE_SIZE,
|
|
19
|
-
description: `Number of sessions to show (${LIST_PAGE_SIZE_MIN}-${LIST_PAGE_SIZE_MAX})`,
|
|
20
|
-
max: LIST_PAGE_SIZE_MAX,
|
|
21
|
-
min: LIST_PAGE_SIZE_MIN,
|
|
22
|
-
}),
|
|
23
|
-
workspace: Flags.string({
|
|
24
|
-
description: 'Copado AI workspace UUID to filter sessions',
|
|
25
|
-
}),
|
|
26
|
-
};
|
|
27
|
-
async run() {
|
|
28
|
-
const { flags } = await this.parse(AiSessionList);
|
|
29
|
-
const page = await this.withSpinner('Loading AI sessions', () => listAiSessions({
|
|
30
|
-
...aiGatewayCallOptions(flags),
|
|
31
|
-
cursor: flags.cursor,
|
|
32
|
-
pageSize: flags['page-size'],
|
|
33
|
-
workspace: flags.workspace,
|
|
34
|
-
}));
|
|
35
|
-
this.display(() => {
|
|
36
|
-
if (page.data.length === 0) {
|
|
37
|
-
this.log('No AI sessions found.');
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
this.log(formatAiSessionTable(page.data));
|
|
41
|
-
displayListPagination(this.log.bind(this), page);
|
|
42
|
-
});
|
|
43
|
-
return page;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/ai/session/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,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CACH,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAA;gBACjC,OAAM;YACR,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YACzC,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
-
import { type AiChatSessionResult } from '../../../lib/ai-chat-session.js';
|
|
3
|
-
export default class AiSessionStart extends AgentiaCommand {
|
|
4
|
-
static description: string;
|
|
5
|
-
static enableJsonFlag: boolean;
|
|
6
|
-
static examples: string[];
|
|
7
|
-
static flags: {
|
|
8
|
-
'sf-org': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
'user-story': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
timeout: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
agent: import("@oclif/core/interfaces").OptionFlag<"plan" | "build" | "test" | "release" | "operate" | "knowledge" | "orchestrate", import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
component: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
dialogue: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
-
};
|
|
16
|
-
run(): Promise<AiChatSessionResult>;
|
|
17
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
|
-
import { stdin as input } from 'node:process';
|
|
3
|
-
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
4
|
-
import { aiConnectionFlags, aiGatewayCallOptions } from '../../../lib/ai-flags.js';
|
|
5
|
-
import { runAiSessionTui } from '../../../lib/ai-session-tui.js';
|
|
6
|
-
import { AI_CHAT_AGENTS } from '../../../lib/ai-types.js';
|
|
7
|
-
export default class AiSessionStart extends AgentiaCommand {
|
|
8
|
-
static description = 'Start or resume an interactive Copado AI session';
|
|
9
|
-
static enableJsonFlag = false;
|
|
10
|
-
static examples = [
|
|
11
|
-
'<%= config.bin %> <%= command.id %>',
|
|
12
|
-
'<%= config.bin %> <%= command.id %> --dialogue 42d0b908-37b7-4565-9ec9-86eda40c9782',
|
|
13
|
-
'<%= config.bin %> <%= command.id %> --agent build --user-story US-1042',
|
|
14
|
-
];
|
|
15
|
-
static flags = {
|
|
16
|
-
agent: Flags.option({
|
|
17
|
-
default: 'orchestrate',
|
|
18
|
-
description: 'Copado AI agent to start on',
|
|
19
|
-
options: [...AI_CHAT_AGENTS],
|
|
20
|
-
})(),
|
|
21
|
-
component: Flags.string({
|
|
22
|
-
description: 'Metadata component name prepended to the first prompt as context',
|
|
23
|
-
}),
|
|
24
|
-
dialogue: Flags.string({
|
|
25
|
-
description: 'Copado AI dialogue UUID to resume',
|
|
26
|
-
}),
|
|
27
|
-
...aiConnectionFlags,
|
|
28
|
-
'sf-org': Flags.string({
|
|
29
|
-
description: 'Salesforce org or environment name prepended to the first prompt as context',
|
|
30
|
-
}),
|
|
31
|
-
'user-story': Flags.string({
|
|
32
|
-
description: 'Copado user story id prepended to the first prompt as context',
|
|
33
|
-
}),
|
|
34
|
-
workspace: Flags.string({
|
|
35
|
-
description: 'Override the workspace UUID from auth or AGENTIA_AI_WORKSPACE; omit to use that default',
|
|
36
|
-
}),
|
|
37
|
-
};
|
|
38
|
-
async run() {
|
|
39
|
-
const { flags } = await this.parse(AiSessionStart);
|
|
40
|
-
if (!input.isTTY) {
|
|
41
|
-
this.error('AI session start requires an interactive terminal. Use `agentia ai agent ask` for headless prompts.', {
|
|
42
|
-
exit: 2,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const options = {
|
|
46
|
-
agent: flags.agent,
|
|
47
|
-
component: flags.component,
|
|
48
|
-
dialogue: flags.dialogue,
|
|
49
|
-
loadHistory: true,
|
|
50
|
-
sameSessionAgentSwitch: true,
|
|
51
|
-
sessionCommands: true,
|
|
52
|
-
...aiGatewayCallOptions(flags),
|
|
53
|
-
sfOrg: flags['sf-org'],
|
|
54
|
-
userStory: flags['user-story'],
|
|
55
|
-
workspace: flags.workspace,
|
|
56
|
-
};
|
|
57
|
-
return runAiSessionTui(options);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=start.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../../src/commands/ai/session/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AACjC,OAAO,EAAC,KAAK,IAAI,KAAK,EAAC,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAE9D,OAAO,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,0BAA0B,CAAA;AAChF,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAC,cAAc,EAAe,MAAM,0BAA0B,CAAA;AAErE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;IACxD,MAAM,CAAU,WAAW,GAAG,kDAAkD,CAAA;IAChF,MAAM,CAAU,cAAc,GAAG,KAAK,CAAA;I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AAK,CAAC,QAAQ,CAAC;YACtB,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAA;QAED,OAAO,eAAe,CAAC,OAAO,CAAC,CAAA;IACjC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const COPADO_CONTEXT_HUB_TITLE = "CopadoContextHub";
|
|
2
|
-
/** Compact FIGlet-style art; two lines so an 80-column terminal still fits. */
|
|
3
|
-
export declare const COPADO_CONTEXT_HUB_ART: string;
|
|
4
|
-
export declare const BANNER_GRADIENT: readonly ["cyan", "cyanBright", "blue", "blueBright", "magenta", "magentaBright"];
|
|
5
|
-
export declare function bannerUsesColor(): boolean;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const COPADO_CONTEXT_HUB_TITLE = 'CopadoContextHub';
|
|
2
|
-
/** Compact FIGlet-style art; two lines so an 80-column terminal still fits. */
|
|
3
|
-
export const COPADO_CONTEXT_HUB_ART = [
|
|
4
|
-
' ____ _',
|
|
5
|
-
' / ___|___ _ __ __ _ __| | ___',
|
|
6
|
-
'| | / _ \\| \'_ \\ / _` |/ _` |/ _ \\',
|
|
7
|
-
'| |__| (_) | |_) | (_| | (_| | (_) |',
|
|
8
|
-
String.raw ` \____\___/| .__/ \__,_|\__,_|\___/`,
|
|
9
|
-
' |_|',
|
|
10
|
-
' ____ _ _ _ _ _',
|
|
11
|
-
' / ___|___ _ __ | |_ _____ _| |_| | | |_ _| |__',
|
|
12
|
-
'| | / _ \\| \'_ \\| __/ _ \\ \\/ / __| |_| | | | | \'_ \\',
|
|
13
|
-
'| |__| (_) | | | | || __/> <| |_| _ | |_| | |_) |',
|
|
14
|
-
String.raw ` \____\___/|_| |_|\__\___/_/\_\\__|_| |_|\__,_|_.__/`,
|
|
15
|
-
].join('\n');
|
|
16
|
-
export const BANNER_GRADIENT = ['cyan', 'cyanBright', 'blue', 'blueBright', 'magenta', 'magentaBright'];
|
|
17
|
-
export function bannerUsesColor() {
|
|
18
|
-
return process.env.NO_COLOR === undefined;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=ai-session-banner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-session-banner.js","sourceRoot":"","sources":["../../src/lib/ai-session-banner.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAA;AAE1D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,+BAA+B;IAC/B,oCAAoC;IACpC,yCAAyC;IACzC,sCAAsC;IACtC,MAAM,CAAC,GAAG,CAAA,qCAAqC;IAC/C,gBAAgB;IAChB,kDAAkD;IAClD,qDAAqD;IACrD,6DAA6D;IAC7D,uDAAuD;IACvD,MAAM,CAAC,GAAG,CAAA,sDAAsD;CACjE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,CAAU,CAAA;AAEhH,MAAM,UAAU,eAAe;IAC7B,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAA;AAC3C,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export function splitAgentMarkdown(text) {
|
|
2
|
-
const blocks = [];
|
|
3
|
-
const prose = [];
|
|
4
|
-
let code;
|
|
5
|
-
let language = '';
|
|
6
|
-
const flushProse = () => {
|
|
7
|
-
const value = prose.join('\n');
|
|
8
|
-
prose.length = 0;
|
|
9
|
-
if (value.length > 0)
|
|
10
|
-
blocks.push({ text: value, type: 'prose' });
|
|
11
|
-
};
|
|
12
|
-
for (const line of text.split('\n')) {
|
|
13
|
-
const trimmed = line.trim();
|
|
14
|
-
if (code === undefined && trimmed.startsWith('```')) {
|
|
15
|
-
flushProse();
|
|
16
|
-
language = trimmed.slice(3).trim();
|
|
17
|
-
code = [];
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
if (code !== undefined && trimmed === '```') {
|
|
21
|
-
blocks.push({ code: code.join('\n'), language, type: 'code' });
|
|
22
|
-
code = undefined;
|
|
23
|
-
language = '';
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (code === undefined)
|
|
27
|
-
prose.push(line);
|
|
28
|
-
else
|
|
29
|
-
code.push(line);
|
|
30
|
-
}
|
|
31
|
-
if (code !== undefined)
|
|
32
|
-
blocks.push({ code: code.join('\n'), language, type: 'code' });
|
|
33
|
-
flushProse();
|
|
34
|
-
return blocks;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=ai-session-tui-blocks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-session-tui-blocks.js","sourceRoot":"","sources":["../../src/lib/ai-session-tui-blocks.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,MAAM,MAAM,GAAyB,EAAE,CAAA;IACvC,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,IAA0B,CAAA;IAC9B,IAAI,QAAQ,GAAG,EAAE,CAAA;IAEjB,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9B,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QAChB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC,CAAA;IACjE,CAAC,CAAA;IAED,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QAC3B,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACpD,UAAU,EAAE,CAAA;YACZ,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;YAClC,IAAI,GAAG,EAAE,CAAA;YACT,SAAQ;QACV,CAAC;QAED,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;YAC5C,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAA;YAC5D,IAAI,GAAG,SAAS,CAAA;YAChB,QAAQ,GAAG,EAAE,CAAA;YACb,SAAQ;QACV,CAAC;QAED,IAAI,IAAI,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;YACnC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC;IAED,IAAI,IAAI,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAA;IACpF,UAAU,EAAE,CAAA;IACZ,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type ChildProcess } from 'node:child_process';
|
|
2
|
-
export type CopyTextToClipboardDeps = {
|
|
3
|
-
env?: NodeJS.ProcessEnv;
|
|
4
|
-
platform?: NodeJS.Platform;
|
|
5
|
-
spawnImpl?: (command: string, args: readonly string[], options?: {
|
|
6
|
-
stdio?: Array<'ignore' | 'pipe'>;
|
|
7
|
-
}) => ChildProcess;
|
|
8
|
-
stdout?: {
|
|
9
|
-
write: (chunk: string) => boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export type CopyTextFn = (text: string, deps?: CopyTextToClipboardDeps) => Promise<void>;
|
|
13
|
-
export declare function lastMarkdownCodeFence(messages: Array<{
|
|
14
|
-
kind: string;
|
|
15
|
-
text: string;
|
|
16
|
-
}>): undefined | {
|
|
17
|
-
code: string;
|
|
18
|
-
language: string;
|
|
19
|
-
};
|
|
20
|
-
export declare function copyTextToClipboard(text: string, deps?: CopyTextToClipboardDeps): Promise<void>;
|
|
21
|
-
export declare function setCopyTextToClipboardForTests(fn: CopyTextFn): void;
|
|
22
|
-
export declare function resetCopyTextToClipboardForTests(): void;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process';
|
|
2
|
-
import { platform as osPlatform } from 'node:os';
|
|
3
|
-
import { splitAgentMarkdown } from './ai-session-tui-blocks.js';
|
|
4
|
-
export function lastMarkdownCodeFence(messages) {
|
|
5
|
-
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
6
|
-
const message = messages[index];
|
|
7
|
-
if (message?.kind !== 'agent')
|
|
8
|
-
continue;
|
|
9
|
-
const blocks = splitAgentMarkdown(message.text);
|
|
10
|
-
for (let blockIndex = blocks.length - 1; blockIndex >= 0; blockIndex -= 1) {
|
|
11
|
-
const block = blocks[blockIndex];
|
|
12
|
-
if (block?.type !== 'code' || block.code.trim().length === 0)
|
|
13
|
-
continue;
|
|
14
|
-
return { code: block.code, language: block.language };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
function clipboardCommand(currentPlatform, env) {
|
|
20
|
-
if (currentPlatform === 'darwin')
|
|
21
|
-
return { args: [], command: 'pbcopy' };
|
|
22
|
-
if (currentPlatform === 'win32')
|
|
23
|
-
return { args: [], command: 'clip' };
|
|
24
|
-
if (typeof env.WAYLAND_DISPLAY === 'string' && env.WAYLAND_DISPLAY.length > 0)
|
|
25
|
-
return { args: [], command: 'wl-copy' };
|
|
26
|
-
if (typeof env.DISPLAY === 'string' && env.DISPLAY.length > 0)
|
|
27
|
-
return { args: ['-selection', 'clipboard'], command: 'xclip' };
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
function defaultSpawn(command, args) {
|
|
31
|
-
return spawn(command, [...args], { stdio: ['pipe', 'ignore', 'ignore'] });
|
|
32
|
-
}
|
|
33
|
-
function copyWithHelper(text, command, args, spawnImpl) {
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
const child = spawnImpl(command, args, { stdio: ['pipe', 'ignore', 'ignore'] });
|
|
36
|
-
const timer = setTimeout(() => {
|
|
37
|
-
child.kill();
|
|
38
|
-
reject(new Error('Clipboard helper timed out.'));
|
|
39
|
-
}, 3000);
|
|
40
|
-
child.once('error', (error) => {
|
|
41
|
-
clearTimeout(timer);
|
|
42
|
-
reject(error);
|
|
43
|
-
});
|
|
44
|
-
child.once('close', (code) => {
|
|
45
|
-
clearTimeout(timer);
|
|
46
|
-
if (code === 0)
|
|
47
|
-
resolve();
|
|
48
|
-
else
|
|
49
|
-
reject(new Error('Clipboard helper failed.'));
|
|
50
|
-
});
|
|
51
|
-
child.stdin?.end(text, 'utf8');
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
async function defaultCopyTextToClipboard(text, deps = {}) {
|
|
55
|
-
const encoded = Buffer.from(text, 'utf8').toString('base64');
|
|
56
|
-
const stdout = deps.stdout ?? process.stdout;
|
|
57
|
-
stdout.write(`\u001B]52;c;${encoded}\u0007`);
|
|
58
|
-
const clipboard = clipboardCommand(deps.platform ?? osPlatform(), deps.env ?? process.env);
|
|
59
|
-
if (clipboard === undefined)
|
|
60
|
-
return;
|
|
61
|
-
try {
|
|
62
|
-
await copyWithHelper(text, clipboard.command, clipboard.args, deps.spawnImpl ?? defaultSpawn);
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
// OSC 52 is enough on terminals that honor it; helpers are best-effort.
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
let copyTextFn = defaultCopyTextToClipboard;
|
|
69
|
-
export async function copyTextToClipboard(text, deps) {
|
|
70
|
-
await copyTextFn(text, deps);
|
|
71
|
-
}
|
|
72
|
-
export function setCopyTextToClipboardForTests(fn) {
|
|
73
|
-
copyTextFn = fn;
|
|
74
|
-
}
|
|
75
|
-
export function resetCopyTextToClipboardForTests() {
|
|
76
|
-
copyTextFn = defaultCopyTextToClipboard;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=ai-session-tui-clipboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-session-tui-clipboard.js","sourceRoot":"","sources":["../../src/lib/ai-session-tui-clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,EAAC,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAC,QAAQ,IAAI,UAAU,EAAC,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AAW7D,MAAM,UAAU,qBAAqB,CAAC,QAA6C;IACjF,KAAK,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC7D,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC/B,IAAI,OAAO,EAAE,IAAI,KAAK,OAAO;YAAE,SAAQ;QACvC,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC/C,KAAK,IAAI,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,UAAU,IAAI,CAAC,EAAE,UAAU,IAAI,CAAC,EAAE,CAAC;YAC1E,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;YAChC,IAAI,KAAK,EAAE,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;gBAAE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;QAAE,OAAM;IACnC,IAAI,CAAC;QACH,MAAM,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,IAAI,YAAY,CAAC,CAAA;IAC/F,CAAC;IAAC,MAAM,CAAC;QACP,wEAAwE;IAC1E,CAAC;AACH,CAAC;AAED,IAAI,UAAU,GAAe,0BAA0B,CAAA;AAEvD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAY,EAAE,IAA8B;IACpF,MAAM,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,EAAc;IAC3D,UAAU,GAAG,EAAE,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,gCAAgC;IAC9C,UAAU,GAAG,0BAA0B,CAAA;AACzC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare const COMPOSER_MAX_ROWS = 3;
|
|
2
|
-
export type ComposerState = {
|
|
3
|
-
cursor: number;
|
|
4
|
-
text: string;
|
|
5
|
-
};
|
|
6
|
-
export type PromptRecallState = {
|
|
7
|
-
draft: string;
|
|
8
|
-
entries: string[];
|
|
9
|
-
index: number;
|
|
10
|
-
};
|
|
11
|
-
export declare function createComposer(text?: string): ComposerState;
|
|
12
|
-
export declare function clampComposerCursor(text: string, cursor: number): number;
|
|
13
|
-
export declare function moveComposerCursor(state: ComposerState, delta: number): ComposerState;
|
|
14
|
-
export declare function composerHome(state: ComposerState): ComposerState;
|
|
15
|
-
export declare function composerEnd(state: ComposerState): ComposerState;
|
|
16
|
-
export declare function insertComposerText(state: ComposerState, value: string): ComposerState;
|
|
17
|
-
export declare function composerBackspace(state: ComposerState): ComposerState;
|
|
18
|
-
export declare function composerDelete(state: ComposerState): ComposerState;
|
|
19
|
-
export declare function createPromptRecall(): PromptRecallState;
|
|
20
|
-
export declare function recordPrompt(recall: PromptRecallState, line: string): PromptRecallState;
|
|
21
|
-
export declare function recallOlder(recall: PromptRecallState, currentText: string): {
|
|
22
|
-
recall: PromptRecallState;
|
|
23
|
-
text: string;
|
|
24
|
-
};
|
|
25
|
-
export declare function recallNewer(recall: PromptRecallState, currentText: string): {
|
|
26
|
-
recall: PromptRecallState;
|
|
27
|
-
text: string;
|
|
28
|
-
};
|
|
29
|
-
export type ComposerRow = {
|
|
30
|
-
caretColumn: number;
|
|
31
|
-
hasCaret: boolean;
|
|
32
|
-
text: string;
|
|
33
|
-
};
|
|
34
|
-
export declare function visibleComposerRows(text: string, cursor: number, width: number, maxRows?: number): ComposerRow[];
|
|
35
|
-
export declare function composerRowCount(text: string, width: number, maxRows?: number): number;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { wrapText } from './ai-session-tui-wrap.js';
|
|
2
|
-
export const COMPOSER_MAX_ROWS = 3;
|
|
3
|
-
export function createComposer(text = '') {
|
|
4
|
-
return { cursor: text.length, text };
|
|
5
|
-
}
|
|
6
|
-
export function clampComposerCursor(text, cursor) {
|
|
7
|
-
return Math.min(Math.max(0, cursor), text.length);
|
|
8
|
-
}
|
|
9
|
-
export function moveComposerCursor(state, delta) {
|
|
10
|
-
return { cursor: clampComposerCursor(state.text, state.cursor + delta), text: state.text };
|
|
11
|
-
}
|
|
12
|
-
export function composerHome(state) {
|
|
13
|
-
return { cursor: 0, text: state.text };
|
|
14
|
-
}
|
|
15
|
-
export function composerEnd(state) {
|
|
16
|
-
return { cursor: state.text.length, text: state.text };
|
|
17
|
-
}
|
|
18
|
-
export function insertComposerText(state, value) {
|
|
19
|
-
const text = state.text.slice(0, state.cursor) + value + state.text.slice(state.cursor);
|
|
20
|
-
return { cursor: state.cursor + value.length, text };
|
|
21
|
-
}
|
|
22
|
-
export function composerBackspace(state) {
|
|
23
|
-
if (state.cursor === 0)
|
|
24
|
-
return state;
|
|
25
|
-
const text = state.text.slice(0, state.cursor - 1) + state.text.slice(state.cursor);
|
|
26
|
-
return { cursor: state.cursor - 1, text };
|
|
27
|
-
}
|
|
28
|
-
export function composerDelete(state) {
|
|
29
|
-
if (state.cursor >= state.text.length)
|
|
30
|
-
return state;
|
|
31
|
-
return { cursor: state.cursor, text: state.text.slice(0, state.cursor) + state.text.slice(state.cursor + 1) };
|
|
32
|
-
}
|
|
33
|
-
export function createPromptRecall() {
|
|
34
|
-
return { draft: '', entries: [], index: 0 };
|
|
35
|
-
}
|
|
36
|
-
export function recordPrompt(recall, line) {
|
|
37
|
-
return { draft: '', entries: [...recall.entries, line], index: recall.entries.length + 1 };
|
|
38
|
-
}
|
|
39
|
-
export function recallOlder(recall, currentText) {
|
|
40
|
-
if (recall.entries.length === 0)
|
|
41
|
-
return { recall, text: currentText };
|
|
42
|
-
const atDraft = recall.index >= recall.entries.length;
|
|
43
|
-
const nextIndex = atDraft ? recall.entries.length - 1 : Math.max(0, recall.index - 1);
|
|
44
|
-
const draft = atDraft ? currentText : recall.draft;
|
|
45
|
-
const next = { draft, entries: recall.entries, index: nextIndex };
|
|
46
|
-
return { recall: next, text: recall.entries[nextIndex] ?? currentText };
|
|
47
|
-
}
|
|
48
|
-
export function recallNewer(recall, currentText) {
|
|
49
|
-
if (recall.index >= recall.entries.length)
|
|
50
|
-
return { recall, text: currentText };
|
|
51
|
-
const nextIndex = recall.index + 1;
|
|
52
|
-
const next = { draft: recall.draft, entries: recall.entries, index: nextIndex };
|
|
53
|
-
if (nextIndex >= recall.entries.length)
|
|
54
|
-
return { recall: next, text: recall.draft };
|
|
55
|
-
return { recall: next, text: recall.entries[nextIndex] ?? currentText };
|
|
56
|
-
}
|
|
57
|
-
export function visibleComposerRows(text, cursor, width, maxRows = COMPOSER_MAX_ROWS) {
|
|
58
|
-
const columns = Math.max(1, width);
|
|
59
|
-
const caret = clampComposerCursor(text, cursor);
|
|
60
|
-
const mapped = [];
|
|
61
|
-
const paragraphs = text.split('\n');
|
|
62
|
-
let pos = 0;
|
|
63
|
-
for (const [paragraphIndex, paragraph] of paragraphs.entries()) {
|
|
64
|
-
const wrapped = paragraph.length === 0 ? [''] : wrapText(paragraph, columns);
|
|
65
|
-
for (const [lineIndex, line] of wrapped.entries()) {
|
|
66
|
-
const start = pos;
|
|
67
|
-
const isLastLine = paragraphIndex === paragraphs.length - 1 && lineIndex === wrapped.length - 1;
|
|
68
|
-
const end = pos + line.length;
|
|
69
|
-
const hasCaret = caret >= start && (caret < end || (isLastLine && caret >= end));
|
|
70
|
-
mapped.push({
|
|
71
|
-
caretColumn: hasCaret ? Math.min(line.length, caret - start) : -1,
|
|
72
|
-
hasCaret,
|
|
73
|
-
text: line,
|
|
74
|
-
});
|
|
75
|
-
pos = end;
|
|
76
|
-
}
|
|
77
|
-
if (paragraphIndex < paragraphs.length - 1)
|
|
78
|
-
pos += 1;
|
|
79
|
-
}
|
|
80
|
-
if (mapped.length === 0)
|
|
81
|
-
mapped.push({ caretColumn: 0, hasCaret: true, text: '' });
|
|
82
|
-
if (!mapped.some((row) => row.hasCaret)) {
|
|
83
|
-
const last = mapped.at(-1);
|
|
84
|
-
if (last !== undefined) {
|
|
85
|
-
last.hasCaret = true;
|
|
86
|
-
last.caretColumn = last.text.length;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
const caretIndex = Math.max(0, mapped.findIndex((row) => row.hasCaret));
|
|
90
|
-
const start = Math.max(0, Math.min(caretIndex, Math.max(0, mapped.length - maxRows)));
|
|
91
|
-
return mapped.slice(start, start + maxRows);
|
|
92
|
-
}
|
|
93
|
-
export function composerRowCount(text, width, maxRows = COMPOSER_MAX_ROWS) {
|
|
94
|
-
return Math.max(1, Math.min(maxRows, wrapText(text.length === 0 ? ' ' : text, Math.max(1, width)).length));
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=ai-session-tui-composer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-session-tui-composer.js","sourceRoot":"","sources":["../../src/lib/ai-session-tui-composer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ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BAAgB,CAAC,IAAY,EAAE,KAAa,EAAE,OAAO,GAAG,iBAAiB;IACvF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAC5G,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type HighlightColor = 'blue' | 'cyan' | 'gray' | 'green' | 'magenta' | 'red' | 'yellow';
|
|
2
|
-
export type HighlightSpan = {
|
|
3
|
-
backgroundColor?: string;
|
|
4
|
-
color?: HighlightColor | string;
|
|
5
|
-
dim?: boolean;
|
|
6
|
-
text: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function highlightCodeLine(line: string, language: string): HighlightSpan[];
|
|
9
|
-
export declare function spansText(spans: HighlightSpan[]): string;
|
|
10
|
-
export declare function sliceSpans(spans: HighlightSpan[], start: number, end: number): HighlightSpan[];
|
|
11
|
-
export declare function wrapSpans(spans: HighlightSpan[], width: number): HighlightSpan[][];
|