@codemap-ai/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.
Files changed (41) hide show
  1. package/.claude-plugin/plugin.json +12 -0
  2. package/.codex-plugin/plugin.json +35 -0
  3. package/.cursor-plugin/plugin.json +16 -0
  4. package/agent-pack/README.md +44 -0
  5. package/agent-pack/agents/codemap-explorer.md +12 -0
  6. package/agent-pack/commands/feature-area.md +8 -0
  7. package/agent-pack/rules/install.md +35 -0
  8. package/agent-pack/rules/mcp-first.md +18 -0
  9. package/agent-pack/rules/task-lifecycle.md +11 -0
  10. package/agent-pack/rules/workflow-skills.md +97 -0
  11. package/agent-pack/skills/brainstorming/SKILL.md +41 -0
  12. package/agent-pack/skills/executing-plans/SKILL.md +26 -0
  13. package/agent-pack/skills/feature-area-investigation/SKILL.md +15 -0
  14. package/agent-pack/skills/interpreting-codemap-output/SKILL.md +29 -0
  15. package/agent-pack/skills/mcp-first-exploration/SKILL.md +10 -0
  16. package/agent-pack/skills/safe-edit-and-reimport/SKILL.md +18 -0
  17. package/agent-pack/skills/symbol-level-debugging/SKILL.md +15 -0
  18. package/agent-pack/skills/test-driven-development/SKILL.md +36 -0
  19. package/agent-pack/skills/token-efficient-code-review/SKILL.md +15 -0
  20. package/agent-pack/skills/verification-before-completion/SKILL.md +25 -0
  21. package/agent-pack/skills/writing-plans/SKILL.md +32 -0
  22. package/agent-pack/templates/AGENTS.md +21 -0
  23. package/agent-pack/templates/CLAUDE.md +19 -0
  24. package/agent-pack/templates/COPILOT.md +75 -0
  25. package/agent-pack/templates/GEMINI.md +77 -0
  26. package/agent-pack/templates/design-spec.md +34 -0
  27. package/agent-pack/templates/implementation-plan.md +26 -0
  28. package/agent-pack/templates/opencode-AGENTS.md +76 -0
  29. package/agent-pack/templates/opencode-INSTALL.md +5 -0
  30. package/agent-pack/templates/verification-report.md +18 -0
  31. package/dist/chat-terminal-DFFYQ6AF.js +1743 -0
  32. package/dist/chunk-A2QHID6K.js +34 -0
  33. package/dist/chunk-AXGGL47C.js +457 -0
  34. package/dist/chunk-FFFJKKKM.js +218262 -0
  35. package/dist/chunk-KWYP3ADN.js +1742 -0
  36. package/dist/chunk-WNJNT3FC.js +216 -0
  37. package/dist/chunk-YRXVMFXS.js +99 -0
  38. package/dist/index.js +9225 -0
  39. package/dist/login-screen-2DJBDM47.js +143 -0
  40. package/dist/pi-tui-app-GVZ3AN42.js +2073 -0
  41. package/package.json +59 -0
@@ -0,0 +1,143 @@
1
+ import{createRequire as __cmr}from"node:module";import{fileURLToPath as __f2p}from"node:url";import{dirname as __dn}from"node:path";var require=__cmr(import.meta.url);var __filename=__f2p(import.meta.url);var __dirname=__dn(__filename);
2
+ import {
3
+ BOLD,
4
+ C_ACTION,
5
+ C_ERROR,
6
+ C_GRAY,
7
+ C_SUCCESS,
8
+ C_WHITE,
9
+ RESET
10
+ } from "./chunk-YRXVMFXS.js";
11
+ import {
12
+ runLoginFlow
13
+ } from "./chunk-AXGGL47C.js";
14
+
15
+ // src/cli-agent/chat/ui/pi-tui/login-screen.ts
16
+ import {
17
+ Container,
18
+ Key,
19
+ matchesKey,
20
+ ProcessTerminal,
21
+ SelectList,
22
+ Text,
23
+ TUI
24
+ } from "@earendil-works/pi-tui";
25
+ import cfonts from "cfonts";
26
+ function buildBannerLines() {
27
+ try {
28
+ const result = cfonts.render("CODEMAP", {
29
+ font: "simple3d",
30
+ gradient: ["cyan", "magenta"],
31
+ transitionColors: true,
32
+ env: "node"
33
+ });
34
+ const raw = result.string ?? "";
35
+ const lines = raw.split("\n");
36
+ let s = 0, e = lines.length - 1;
37
+ while (s <= e && (lines[s] ?? "").replace(/\x1b\[[0-9;]*m/g, "").trim() === "") s++;
38
+ while (e >= s && (lines[e] ?? "").replace(/\x1b\[[0-9;]*m/g, "").trim() === "") e--;
39
+ return lines.slice(s, e + 1);
40
+ } catch {
41
+ return [" CODEMAP"];
42
+ }
43
+ }
44
+ var ITEMS = [
45
+ {
46
+ value: "login",
47
+ label: "Login to CodeMap",
48
+ description: "Opens browser \u2014 required for cloud features (graph, insights, team sharing)"
49
+ },
50
+ {
51
+ value: "continue",
52
+ label: "Continue without login",
53
+ description: "Local tools only \u2014 search, edit, bash work without a cloud account"
54
+ },
55
+ {
56
+ value: "exit",
57
+ label: "Exit",
58
+ description: ""
59
+ }
60
+ ];
61
+ var SELECT_THEME = {
62
+ selectedPrefix: (t) => `${C_ACTION}\u276F ${t}${RESET}`,
63
+ selectedText: (t) => `${C_WHITE}${BOLD}${t}${RESET}`,
64
+ description: (t) => ` ${C_GRAY}${t}${RESET}`,
65
+ scrollInfo: (t) => `${C_GRAY}${t}${RESET}`,
66
+ noMatch: (t) => `${C_GRAY}${t}${RESET}`
67
+ };
68
+ async function showLoginScreen(config) {
69
+ return new Promise((resolve) => {
70
+ const terminal = new ProcessTerminal();
71
+ const tui = new TUI(terminal, false);
72
+ const root = new Container();
73
+ const bannerLines = buildBannerLines();
74
+ const banner = new Text(bannerLines.join("\n"));
75
+ const subtitle = new Text(`${C_GRAY} AI-POWERED CODE INTELLIGENCE & AGENT PLATFORM${RESET}
76
+ `);
77
+ const heading = new Text(`${C_WHITE}${BOLD} Welcome \u2014 you are not logged in.${RESET}
78
+ `);
79
+ const select = new SelectList(ITEMS, ITEMS.length, SELECT_THEME);
80
+ select.onSelect = async (item) => {
81
+ if (item.value === "exit") {
82
+ tui.stop();
83
+ resolve("exit");
84
+ return;
85
+ }
86
+ if (item.value === "continue") {
87
+ tui.stop();
88
+ resolve("skip");
89
+ return;
90
+ }
91
+ root.removeChild(select);
92
+ const status = new Text(`${C_ACTION} Opening browser for CodeMap login...${RESET}`);
93
+ root.addChild(status);
94
+ tui.requestRender();
95
+ try {
96
+ const result = await runLoginFlow(config);
97
+ tui.stop();
98
+ const name = result.user?.name ?? result.user?.email ?? "user";
99
+ process.stdout.write(`
100
+ ${C_SUCCESS} \u2713 Logged in as ${name}${RESET}
101
+
102
+ `);
103
+ resolve("loggedin");
104
+ } catch (err) {
105
+ const msg = err instanceof Error ? err.message : String(err);
106
+ root.removeChild(status);
107
+ root.addChild(new Text(`${C_ERROR} Login failed: ${msg}${RESET}
108
+ `));
109
+ root.addChild(new Text(`${C_GRAY} Press any key to continue without login...${RESET}`));
110
+ tui.requestRender();
111
+ tui.addInputListener(() => {
112
+ tui.stop();
113
+ resolve("skip");
114
+ return { consume: true };
115
+ });
116
+ }
117
+ };
118
+ select.onCancel = () => {
119
+ tui.stop();
120
+ resolve("exit");
121
+ };
122
+ root.addChild(banner);
123
+ root.addChild(subtitle);
124
+ root.addChild(heading);
125
+ root.addChild(select);
126
+ tui.addChild(root);
127
+ tui.setFocus(select);
128
+ tui.addInputListener((data) => {
129
+ if (matchesKey(data, Key.ctrl("c"))) {
130
+ tui.stop();
131
+ resolve("exit");
132
+ return { consume: true };
133
+ }
134
+ select.handleInput(data);
135
+ tui.requestRender();
136
+ return { consume: true };
137
+ });
138
+ tui.start();
139
+ });
140
+ }
141
+ export {
142
+ showLoginScreen
143
+ };