@odysx/codemind 0.0.0-stage → 0.1.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.
Files changed (108) hide show
  1. package/README.md +293 -2
  2. package/dist/commands/agents.d.ts +2 -0
  3. package/dist/commands/agents.js +91 -0
  4. package/dist/commands/auth.d.ts +2 -0
  5. package/dist/commands/auth.js +35 -0
  6. package/dist/commands/chat.d.ts +2 -0
  7. package/dist/commands/chat.js +180 -0
  8. package/dist/commands/keys.d.ts +2 -0
  9. package/dist/commands/keys.js +81 -0
  10. package/dist/commands/local.d.ts +2 -0
  11. package/dist/commands/local.js +325 -0
  12. package/dist/commands/mcp.d.ts +2 -0
  13. package/dist/commands/mcp.js +73 -0
  14. package/dist/commands/prompts.d.ts +2 -0
  15. package/dist/commands/prompts.js +59 -0
  16. package/dist/commands/skills.d.ts +2 -0
  17. package/dist/commands/skills.js +41 -0
  18. package/dist/core/auth/index.d.ts +10 -0
  19. package/dist/core/auth/index.js +82 -0
  20. package/dist/core/config/index.d.ts +47 -0
  21. package/dist/core/config/index.js +118 -0
  22. package/dist/core/history.d.ts +14 -0
  23. package/dist/core/history.js +80 -0
  24. package/dist/core/markdown-renderer.d.ts +47 -0
  25. package/dist/core/markdown-renderer.js +385 -0
  26. package/dist/core/permissions/index.d.ts +31 -0
  27. package/dist/core/permissions/index.js +64 -0
  28. package/dist/core/provider/external.d.ts +28 -0
  29. package/dist/core/provider/external.js +248 -0
  30. package/dist/core/provider/index.d.ts +138 -0
  31. package/dist/core/provider/index.js +510 -0
  32. package/dist/core/registry/index.d.ts +25 -0
  33. package/dist/core/registry/index.js +216 -0
  34. package/dist/core/schema/types.d.ts +93 -0
  35. package/dist/core/schema/types.js +12 -0
  36. package/dist/core/terminal.d.ts +40 -0
  37. package/dist/core/terminal.js +134 -0
  38. package/dist/core/workspace/index.d.ts +35 -0
  39. package/dist/core/workspace/index.js +194 -0
  40. package/dist/index.d.ts +10 -0
  41. package/dist/index.js +393 -0
  42. package/dist/ui/app.d.ts +3 -0
  43. package/dist/ui/app.js +554 -0
  44. package/dist/ui/commands/cases/catalog.d.ts +11 -0
  45. package/dist/ui/commands/cases/catalog.js +62 -0
  46. package/dist/ui/commands/cases/misc.d.ts +35 -0
  47. package/dist/ui/commands/cases/misc.js +245 -0
  48. package/dist/ui/commands/cases/tasks.d.ts +13 -0
  49. package/dist/ui/commands/cases/tasks.js +91 -0
  50. package/dist/ui/commands/runCommand.d.ts +22 -0
  51. package/dist/ui/commands/runCommand.js +136 -0
  52. package/dist/ui/components/AgentPicker.d.ts +11 -0
  53. package/dist/ui/components/AgentPicker.js +7 -0
  54. package/dist/ui/components/AuthPicker.d.ts +14 -0
  55. package/dist/ui/components/AuthPicker.js +7 -0
  56. package/dist/ui/components/Banner.d.ts +8 -0
  57. package/dist/ui/components/Banner.js +24 -0
  58. package/dist/ui/components/CommandMenu.d.ts +17 -0
  59. package/dist/ui/components/CommandMenu.js +21 -0
  60. package/dist/ui/components/ErrorBoundary.d.ts +24 -0
  61. package/dist/ui/components/ErrorBoundary.js +51 -0
  62. package/dist/ui/components/InputBar.d.ts +28 -0
  63. package/dist/ui/components/InputBar.js +108 -0
  64. package/dist/ui/components/KeysPanel.d.ts +12 -0
  65. package/dist/ui/components/KeysPanel.js +25 -0
  66. package/dist/ui/components/MessageView.d.ts +29 -0
  67. package/dist/ui/components/MessageView.js +107 -0
  68. package/dist/ui/components/PermissionPrompt.d.ts +10 -0
  69. package/dist/ui/components/PermissionPrompt.js +4 -0
  70. package/dist/ui/components/Pickers.d.ts +43 -0
  71. package/dist/ui/components/Pickers.js +33 -0
  72. package/dist/ui/components/SearchOverlay.d.ts +21 -0
  73. package/dist/ui/components/SearchOverlay.js +14 -0
  74. package/dist/ui/components/SessionPicker.d.ts +12 -0
  75. package/dist/ui/components/SessionPicker.js +8 -0
  76. package/dist/ui/components/WorkingIndicator.d.ts +10 -0
  77. package/dist/ui/components/WorkingIndicator.js +23 -0
  78. package/dist/ui/controls/ApiKeyEntry.d.ts +8 -0
  79. package/dist/ui/controls/ApiKeyEntry.js +5 -0
  80. package/dist/ui/controls/MultiSelect.d.ts +18 -0
  81. package/dist/ui/controls/MultiSelect.js +9 -0
  82. package/dist/ui/hooks/useAgentPicker.d.ts +14 -0
  83. package/dist/ui/hooks/useAgentPicker.js +53 -0
  84. package/dist/ui/hooks/useAuthFlow.d.ts +14 -0
  85. package/dist/ui/hooks/useAuthFlow.js +31 -0
  86. package/dist/ui/hooks/useKeysFlow.d.ts +17 -0
  87. package/dist/ui/hooks/useKeysFlow.js +130 -0
  88. package/dist/ui/hooks/useSessionPicker.d.ts +29 -0
  89. package/dist/ui/hooks/useSessionPicker.js +58 -0
  90. package/dist/ui/hooks/useTerminalSize.d.ts +6 -0
  91. package/dist/ui/hooks/useTerminalSize.js +29 -0
  92. package/dist/ui/input/keyRouter.d.ts +125 -0
  93. package/dist/ui/input/keyRouter.js +574 -0
  94. package/dist/ui/layouts/ScreenLayout.d.ts +98 -0
  95. package/dist/ui/layouts/ScreenLayout.js +56 -0
  96. package/dist/ui/shared/types.d.ts +143 -0
  97. package/dist/ui/shared/types.js +38 -0
  98. package/dist/ui/theme.d.ts +29 -0
  99. package/dist/ui/theme.js +54 -0
  100. package/dist/ui/utils/markdown.d.ts +74 -0
  101. package/dist/ui/utils/markdown.js +187 -0
  102. package/dist/ui/utils/mentions.d.ts +12 -0
  103. package/dist/ui/utils/mentions.js +28 -0
  104. package/dist/ui/utils/terminal-text.d.ts +33 -0
  105. package/dist/ui/utils/terminal-text.js +123 -0
  106. package/dist/ui/utils/text.d.ts +72 -0
  107. package/dist/ui/utils/text.js +171 -0
  108. package/package.json +50 -6
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Terminal-text hygiene: sanitization and display width.
3
+ *
4
+ * Two properties matter when rendering untrusted text (model output, file
5
+ * contents pulled in through @mentions, error messages from a remote server)
6
+ * into a terminal:
7
+ *
8
+ * 1. Escape sequences must never reach the terminal. A model reply
9
+ * containing `\x1b[2J` can clear the screen, `\x1b[?1049l` can drop the
10
+ * user out of the alternate buffer, and OSC 8/52 can rewrite the title or
11
+ * the clipboard. Ink has no sanitizer of its own.
12
+ * 2. Display width is not string length. Emoji and CJK glyphs occupy two
13
+ * columns; combining marks and zero-width joiners occupy none. Padding a
14
+ * table cell by `.length` misaligns every column after the first wide
15
+ * glyph, and a border drawn to a width computed in code units wraps.
16
+ */
17
+ /* ── Sanitization ───────────────────────────────────────────────────────── */
18
+ // CSI: ESC [ params intermediates final
19
+ // OSC: ESC ] … (BEL | ESC \) DCS/PM/APC: ESC P|^|_ … (ESC \)
20
+ // Plus single-character ESC sequences and the C1 range.
21
+ // eslint-disable-next-line no-control-regex
22
+ const ESCAPE_SEQUENCE = /\x1B(?:\[[0-?]*[ -/]*[@-~]|\][^\x07\x1B]*(?:\x07|\x1B\\)|[P^_][\s\S]*?\x1B\\|[@-Z\\-_])|\x9B[0-?]*[ -/]*[@-~]|\x07/g;
23
+ /**
24
+ * Strip control sequences that could alter terminal state.
25
+ *
26
+ * Newlines and tabs are preserved (they are layout, not control), and so are
27
+ * carriage returns *only* when asked — a lone CR can overwrite the current
28
+ * line, so it is normalized away by default.
29
+ */
30
+ export const sanitize = (text, keepNewlines = true) => {
31
+ let out = text.replace(ESCAPE_SEQUENCE, "");
32
+ // Other C0 control characters that would corrupt the frame. \n (0x0A) and
33
+ // \t (0x09) stay; \r (0x0D) goes — a bare CR rewrites the current line.
34
+ out = out.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, "");
35
+ if (!keepNewlines)
36
+ out = out.replace(/\r?\n/g, " ");
37
+ return out;
38
+ };
39
+ /** True when the text contains something `sanitize` would remove. */
40
+ export const hasControlSequences = (text) => ESCAPE_SEQUENCE.test(text);
41
+ /* ── Display width ──────────────────────────────────────────────────────── */
42
+ /**
43
+ * Code points that occupy two terminal columns.
44
+ *
45
+ * This covers the East Asian Wide/Fullwidth ranges and the emoji blocks. It is
46
+ * deliberately a table rather than a dependency: `string-width` pulls in a
47
+ * regex engine and this list only needs to be right for what agents emit.
48
+ */
49
+ const WIDE_RANGES = [
50
+ [0x1100, 0x115f], // Hangul Jamo init
51
+ [0x2e80, 0x303e], // CJK radicals, Kangxi, CJK symbols/punctuation
52
+ [0x3041, 0x33ff], // Hiragana, Katakana, Bopomofo, Hangul compat, CJK compat
53
+ [0x3400, 0x4dbf], // CJK ext A
54
+ [0x4e00, 0x9fff], // CJK unified ideographs
55
+ [0xa000, 0xa4cf], // Yi
56
+ [0xac00, 0xd7a3], // Hangul syllables
57
+ [0xf900, 0xfaff], // CJK compat ideographs
58
+ [0xfe10, 0xfe19], // Vertical forms
59
+ [0xfe30, 0xfe6f], // CJK compat forms
60
+ [0xff00, 0xff60], // Fullwidth forms
61
+ [0xffe0, 0xffe6], // Fullwidth signs
62
+ // Emoji: the whole pictographic block, including transport (🚀 U+1F680),
63
+ // supplemental symbols (U+1F900), and symbols extended-A (U+1FA70).
64
+ [0x1f300, 0x1faff],
65
+ [0x1f650, 0x1f67f], // ornamental dingbats
66
+ [0x1f680, 0x1f6ff], // transport and map symbols
67
+ [0x20000, 0x3fffd], // CJK ext B+
68
+ ];
69
+ /** Zero-width code points: combining marks and joiners. */
70
+ const isZeroWidth = (cp) => (cp >= 0x0300 && cp <= 0x036f) || // combining diacritics
71
+ (cp >= 0x200b && cp <= 0x200f) || // ZWSP/ZWNJ/ZWJ/LRM/RLM
72
+ cp === 0xfeff || // BOM / zero-width no-break space
73
+ (cp >= 0xfe00 && cp <= 0xfe0f) || // variation selectors
74
+ (cp >= 0x1f3fb && cp <= 0x1f3ff); // emoji skin-tone modifiers
75
+ /** Column width of a single code point. */
76
+ const codePointWidth = (cp) => {
77
+ if (isZeroWidth(cp))
78
+ return 0;
79
+ for (const [lo, hi] of WIDE_RANGES) {
80
+ if (cp >= lo && cp <= hi)
81
+ return 2;
82
+ }
83
+ return 1;
84
+ };
85
+ /** Terminal columns occupied by `text` (assumes no escape sequences). */
86
+ export const displayWidth = (text) => {
87
+ let width = 0;
88
+ for (const ch of text)
89
+ width += codePointWidth(ch.codePointAt(0) ?? 0);
90
+ return width;
91
+ };
92
+ /** Truncate to `max` columns, appending `…` when anything was dropped. */
93
+ export const truncateToWidth = (text, max, ellipsis = "…") => {
94
+ if (max <= 0)
95
+ return "";
96
+ if (displayWidth(text) <= max)
97
+ return text;
98
+ const budget = max - displayWidth(ellipsis);
99
+ let out = "";
100
+ let used = 0;
101
+ for (const ch of text) {
102
+ const w = codePointWidth(ch.codePointAt(0) ?? 0);
103
+ if (used + w > budget)
104
+ break;
105
+ out += ch;
106
+ used += w;
107
+ }
108
+ return out + ellipsis;
109
+ };
110
+ /** Pad to exactly `columns` display columns (left/right/center). */
111
+ export const padToWidth = (text, columns, align = "left", fill = " ") => {
112
+ const gap = columns - displayWidth(text);
113
+ if (gap <= 0)
114
+ return text;
115
+ if (align === "right")
116
+ return fill.repeat(gap) + text;
117
+ if (align === "center") {
118
+ const left = Math.floor(gap / 2);
119
+ return fill.repeat(left) + text + fill.repeat(gap - left);
120
+ }
121
+ return text + fill.repeat(gap);
122
+ };
123
+ //# sourceMappingURL=terminal-text.js.map
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Character-level helpers for the prompt editor.
3
+ *
4
+ * The REPL's input is a single line driven by raw key events, so cursor
5
+ * movement has to work on strings. Characters are iterated by code point to
6
+ * keep emoji intact when moving or deleting.
7
+ */
8
+ /** Split into grapheme-ish units: surrogate pairs stay together. */
9
+ export declare const toChars: (text: string) => string[];
10
+ /** Clamp a cursor index to a string's length (in code points). */
11
+ export declare const clampCursor: (cursor: number, text: string) => number;
12
+ /** Move the cursor right by `n` characters. */
13
+ export declare const moveRight: (text: string, cursor: number, n?: number) => number;
14
+ /** Move the cursor left by `n` characters. */
15
+ export declare const moveLeft: (cursor: number, n?: number) => number;
16
+ /** Insert text at the cursor; returns the new value and cursor position. */
17
+ export declare const insertAt: (text: string, cursor: number, insert: string) => {
18
+ text: string;
19
+ cursor: number;
20
+ };
21
+ /** Delete the character before the cursor (backspace). */
22
+ export declare const deleteBefore: (text: string, cursor: number) => {
23
+ text: string;
24
+ cursor: number;
25
+ };
26
+ /** Delete the character at the cursor (delete key). */
27
+ export declare const deleteAt: (text: string, cursor: number) => {
28
+ text: string;
29
+ cursor: number;
30
+ };
31
+ /**
32
+ * Which token does the cursor sit in? Used by the slash menu so it opens for
33
+ * `/cmd` typed mid-prompt, not only at line start.
34
+ */
35
+ export declare const wordAt: (text: string, cursor: number) => {
36
+ word: string;
37
+ start: number;
38
+ };
39
+ /**
40
+ * The whitespace-delimited token around the caret, as a half-open range.
41
+ *
42
+ * `wordAt` stops at the caret (it answers "what has been typed so far"), which
43
+ * is the wrong span for *replacing* a token: completing "/he|lp" needs the
44
+ * whole "/help", or the tail gets re-appended as if it were typed arguments.
45
+ */
46
+ export declare const wordBounds: (text: string, cursor: number) => {
47
+ start: number;
48
+ end: number;
49
+ };
50
+ /**
51
+ * Case-insensitive subsequence score, or -1 when `query` is not a subsequence
52
+ * of `text`. Contiguous and word-start matches score higher so `h` ranks
53
+ * `/help` above `/history`. Code points, not UTF-16 units, so an emoji in a
54
+ * history entry cannot desynchronise the match.
55
+ */
56
+ export declare const fuzzyScore: (text: string, query: string) => number;
57
+ /** Sort by descending score, keeping the original order on ties. */
58
+ export declare const fuzzyRank: <T>(items: T[], query: string, key: (item: T) => string) => T[];
59
+ /** Index of the first character on the cursor's line. */
60
+ export declare const lineStart: (text: string, cursor: number) => number;
61
+ /** Index of the line terminator (or end of text) after the cursor's line. */
62
+ export declare const lineEnd: (text: string, cursor: number) => number;
63
+ /** True when the cursor's line is the first / last one. */
64
+ export declare const onFirstLine: (text: string, cursor: number) => boolean;
65
+ export declare const onLastLine: (text: string, cursor: number) => boolean;
66
+ /**
67
+ * Move the caret one line up (-1) or down (+1), keeping the column where it
68
+ * exists and clamping to the shorter line otherwise — the behavior every
69
+ * text editor has.
70
+ */
71
+ export declare const moveVertical: (text: string, cursor: number, dir: -1 | 1) => number;
72
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Character-level helpers for the prompt editor.
3
+ *
4
+ * The REPL's input is a single line driven by raw key events, so cursor
5
+ * movement has to work on strings. Characters are iterated by code point to
6
+ * keep emoji intact when moving or deleting.
7
+ */
8
+ /** Split into grapheme-ish units: surrogate pairs stay together. */
9
+ export const toChars = (text) => Array.from(text);
10
+ /** Clamp a cursor index to a string's length (in code points). */
11
+ export const clampCursor = (cursor, text) => {
12
+ // Iterating counts code points without allocating an array; this runs on
13
+ // every keystroke, so the array form would be wasteful.
14
+ let length = 0;
15
+ for (const _ of text)
16
+ length++; // eslint-disable-line no-unused-vars
17
+ return Math.max(0, Math.min(cursor, length));
18
+ };
19
+ /** Move the cursor right by `n` characters. */
20
+ export const moveRight = (text, cursor, n = 1) => clampCursor(cursor + n, text);
21
+ /** Move the cursor left by `n` characters. */
22
+ export const moveLeft = (cursor, n = 1) => Math.max(0, cursor - n);
23
+ /** Insert text at the cursor; returns the new value and cursor position. */
24
+ export const insertAt = (text, cursor, insert) => {
25
+ const chars = toChars(text);
26
+ const at = clampCursor(cursor, text);
27
+ chars.splice(at, 0, ...toChars(insert));
28
+ return { text: chars.join(""), cursor: at + toChars(insert).length };
29
+ };
30
+ /** Delete the character before the cursor (backspace). */
31
+ export const deleteBefore = (text, cursor) => {
32
+ const chars = toChars(text);
33
+ const at = clampCursor(cursor, text);
34
+ if (at === 0)
35
+ return { text, cursor: 0 };
36
+ chars.splice(at - 1, 1);
37
+ return { text: chars.join(""), cursor: at - 1 };
38
+ };
39
+ /** Delete the character at the cursor (delete key). */
40
+ export const deleteAt = (text, cursor) => {
41
+ const chars = toChars(text);
42
+ const at = clampCursor(cursor, text);
43
+ if (at >= chars.length)
44
+ return { text, cursor: at };
45
+ chars.splice(at, 1);
46
+ return { text: chars.join(""), cursor: at };
47
+ };
48
+ /**
49
+ * Which token does the cursor sit in? Used by the slash menu so it opens for
50
+ * `/cmd` typed mid-prompt, not only at line start.
51
+ */
52
+ export const wordAt = (text, cursor) => {
53
+ const chars = toChars(text);
54
+ let start = clampCursor(cursor, text);
55
+ while (start > 0 && !/\s/.test(chars[start - 1]))
56
+ start--;
57
+ return { word: chars.slice(start, clampCursor(cursor, text)).join(""), start };
58
+ };
59
+ /**
60
+ * The whitespace-delimited token around the caret, as a half-open range.
61
+ *
62
+ * `wordAt` stops at the caret (it answers "what has been typed so far"), which
63
+ * is the wrong span for *replacing* a token: completing "/he|lp" needs the
64
+ * whole "/help", or the tail gets re-appended as if it were typed arguments.
65
+ */
66
+ export const wordBounds = (text, cursor) => {
67
+ const chars = toChars(text);
68
+ const at = clampCursor(cursor, text);
69
+ let start = at;
70
+ while (start > 0 && !/\s/.test(chars[start - 1]))
71
+ start--;
72
+ let end = at;
73
+ while (end < chars.length && !/\s/.test(chars[end]))
74
+ end++;
75
+ return { start, end };
76
+ };
77
+ /* ── Fuzzy matching for the command palette / history search ───────────── */
78
+ /**
79
+ * Case-insensitive subsequence score, or -1 when `query` is not a subsequence
80
+ * of `text`. Contiguous and word-start matches score higher so `h` ranks
81
+ * `/help` above `/history`. Code points, not UTF-16 units, so an emoji in a
82
+ * history entry cannot desynchronise the match.
83
+ */
84
+ export const fuzzyScore = (text, query) => {
85
+ const q = toChars(query.toLowerCase());
86
+ if (q.length === 0)
87
+ return 0;
88
+ const t = toChars(text.toLowerCase());
89
+ let ti = 0;
90
+ let score = 0;
91
+ let streak = 0;
92
+ for (const needle of q) {
93
+ let found = -1;
94
+ for (let i = ti; i < t.length; i++) {
95
+ if (t[i] === needle) {
96
+ found = i;
97
+ break;
98
+ }
99
+ }
100
+ if (found === -1)
101
+ return -1;
102
+ const wordStart = found === 0 || /\s|\/|-/.test(t[found - 1]);
103
+ streak = found === ti ? streak + 1 : 0;
104
+ score += 10 + streak * 4 + (wordStart ? 6 : 0);
105
+ ti = found + 1;
106
+ }
107
+ // Shorter haystacks are better matches for the same query.
108
+ return score - Math.floor(t.length / 10);
109
+ };
110
+ /** Sort by descending score, keeping the original order on ties. */
111
+ export const fuzzyRank = (items, query, key) => {
112
+ if (!query.trim())
113
+ return items;
114
+ return items
115
+ .map((item, index) => ({ item, index, score: fuzzyScore(key(item), query) }))
116
+ .filter((x) => x.score >= 0)
117
+ .sort((a, b) => b.score - a.score || a.index - b.index)
118
+ .map((x) => x.item);
119
+ };
120
+ /* ── Multiline navigation ──────────────────────────────────────────────── */
121
+ /*
122
+ * EVERY index here is a code-point index, matching `cursor` and `toChars`.
123
+ * The first implementation used `text.indexOf("\n")` / `text.length`, which
124
+ * are UTF-16 offsets: with an emoji earlier in the string the two spaces
125
+ * disagree, so Ctrl+A did nothing, Ctrl+U deleted the wrong range, and ↑/↓
126
+ * jumped to column 0. Convert once and index the array.
127
+ */
128
+ /** Index of the first character on the cursor's line. */
129
+ export const lineStart = (text, cursor) => {
130
+ const chars = toChars(text);
131
+ let at = clampCursor(cursor, text);
132
+ while (at > 0 && chars[at - 1] !== "\n")
133
+ at--;
134
+ return at;
135
+ };
136
+ /** Index of the line terminator (or end of text) after the cursor's line. */
137
+ export const lineEnd = (text, cursor) => {
138
+ const chars = toChars(text);
139
+ let at = clampCursor(cursor, text);
140
+ while (at < chars.length && chars[at] !== "\n")
141
+ at++;
142
+ return at;
143
+ };
144
+ /** True when the cursor's line is the first / last one. */
145
+ export const onFirstLine = (text, cursor) => lineStart(text, cursor) === 0;
146
+ export const onLastLine = (text, cursor) => lineEnd(text, cursor) === toChars(text).length;
147
+ /**
148
+ * Move the caret one line up (-1) or down (+1), keeping the column where it
149
+ * exists and clamping to the shorter line otherwise — the behavior every
150
+ * text editor has.
151
+ */
152
+ export const moveVertical = (text, cursor, dir) => {
153
+ const chars = toChars(text);
154
+ const at = clampCursor(cursor, text);
155
+ const column = at - lineStart(text, at);
156
+ if (dir < 0) {
157
+ const start = lineStart(text, at);
158
+ if (start === 0)
159
+ return at;
160
+ const prevStart = lineStart(text, start - 1);
161
+ const prevEnd = start - 1; // the newline before the current line
162
+ return Math.min(prevStart + column, prevEnd);
163
+ }
164
+ const end = lineEnd(text, at);
165
+ if (end >= chars.length)
166
+ return at;
167
+ const nextStart = end + 1;
168
+ const nextEnd = lineEnd(text, nextStart);
169
+ return Math.min(nextStart + column, nextEnd);
170
+ };
171
+ //# sourceMappingURL=text.js.map
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
- {
2
- "name": "@odysx/codemind",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@odysx/codemind",
3
+ "version": "0.1.1",
4
+ "description": "OdysX CLI — smart agents in your terminal",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "odysx": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist/**/*.js",
12
+ "dist/**/*.d.ts",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "dev": "tsx src/index.ts",
18
+ "lint": "eslint test/",
19
+ "typecheck": "tsc --noEmit",
20
+ "test": "node --test test/*.mjs",
21
+ "link": "npm link"
22
+ },
23
+ "engines": {
24
+ "node": ">=22.12.0"
25
+ },
26
+ "keywords": [
27
+ "cli",
28
+ "agents",
29
+ "ai",
30
+ "mcp",
31
+ "odysx"
32
+ ],
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "@types/react": "^19.2.18",
36
+ "chalk": "^5.6.2",
37
+ "clipanion": "^4.0.0-rc.4",
38
+ "commander": "^15.0.0",
39
+ "ink": "^5.2.1",
40
+ "markdown-it": "^14.3.0",
41
+ "react": "^18.3.1"
42
+ },
43
+ "devDependencies": {
44
+ "@eslint/js": "^9.39.5",
45
+ "@types/markdown-it": "^14.2.0",
46
+ "@types/node": "^26.2.0",
47
+ "eslint": "^9.39.5",
48
+ "typescript": "^7.0.2"
49
+ }
50
+ }