@sortlist/cli 0.30.0 → 0.31.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.
@@ -1,23 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
-
3
- export function useTerminalSize() {
4
- const [size, setSize] = useState({
5
- columns: process.stdout.columns ?? 80,
6
- rows: process.stdout.rows ?? 24,
7
- });
8
-
9
- useEffect(() => {
10
- const onResize = () => {
11
- setSize({
12
- columns: process.stdout.columns ?? 80,
13
- rows: process.stdout.rows ?? 24,
14
- });
15
- };
16
- process.stdout.on('resize', onResize);
17
- return () => {
18
- process.stdout.off('resize', onResize);
19
- };
20
- }, []);
21
-
22
- return size;
23
- }
@@ -1,26 +0,0 @@
1
- import { render } from 'ink';
2
- import React from 'react';
3
-
4
- import { App } from './App.tsx';
5
-
6
- interface LaunchOptions {
7
- companyId: string;
8
- conversationId?: string;
9
- conversationTitle?: string;
10
- endpoint: string;
11
- }
12
-
13
- export function launchInteractive(opts: LaunchOptions): void {
14
- const instance = render(
15
- <App
16
- companyId={opts.companyId}
17
- conversationId={opts.conversationId}
18
- conversationTitle={opts.conversationTitle}
19
- endpoint={opts.endpoint}
20
- />,
21
- );
22
-
23
- instance.waitUntilExit().then(() => {
24
- process.exit(0);
25
- });
26
- }
@@ -1,29 +0,0 @@
1
- import { Marked, type Tokens } from 'marked';
2
- import { markedTerminal } from 'marked-terminal';
3
-
4
- const terminalExt = markedTerminal({
5
- reflowText: true,
6
- width: Math.min(process.stdout.columns ?? 80, 100) - 4,
7
- tab: 2,
8
- }) as Parameters<typeof Marked.prototype.use>[0];
9
-
10
- const marked = new Marked(terminalExt, {
11
- renderer: {
12
- // Override link rendering to avoid "(mailto:...)" noise on email addresses.
13
- // For mailto links, just show the email text. For URLs, show "text (url)".
14
- link({ href, text }: Tokens.Link) {
15
- if (href.startsWith('mailto:')) return text;
16
- if (text === href) return href;
17
- return `${text} (${href})`;
18
- },
19
- },
20
- });
21
-
22
- /**
23
- * Render markdown string to terminal-formatted text.
24
- * Strips trailing newlines to avoid extra spacing in Ink.
25
- */
26
- export function renderMarkdown(input: string): string {
27
- const result = marked.parse(input, { async: false });
28
- return result.replace(/\n+$/, '');
29
- }
@@ -1,34 +0,0 @@
1
- import type { ConversationEventSubscription } from '../../../graphql/generated/graphql.ts';
2
-
3
- export interface Message {
4
- role: 'user' | 'assistant';
5
- content: string;
6
- }
7
-
8
- /**
9
- * One event from the `conversationEvent` subscription — a discriminated union keyed
10
- * by `__typename`. The union matches the inline fragments in `ConversationEvent`.
11
- */
12
- export type ChatEvent = ConversationEventSubscription['conversationEvent'];
13
-
14
- export interface ChatConnection {
15
- onMessage: (fn: (event: ChatEvent) => void) => void;
16
- onClose: (fn: () => void) => void;
17
- close: () => void;
18
- }
19
-
20
- export interface ToolCallInfo {
21
- toolName: string;
22
- toolCallId: string;
23
- label: string; // e.g. "query GetCurrentUser" or "introspect Conversation"
24
- isError: boolean;
25
- resultLabel?: string; // e.g. "✓ done" or "✗ error: ..."
26
- }
27
-
28
- export interface PendingChoice {
29
- toolCallId: string;
30
- question: string;
31
- options: string[];
32
- }
33
-
34
- export type ThinkingEntry = { kind: 'tool_call'; tool: ToolCallInfo };
@@ -1,20 +0,0 @@
1
- declare module 'marked-terminal' {
2
- import type { MarkedExtension } from 'marked';
3
-
4
- interface MarkedTerminalOptions {
5
- reflowText?: boolean;
6
- width?: number;
7
- tab?: number;
8
- showSectionPrefix?: boolean;
9
- unescape?: boolean;
10
- emoji?: boolean;
11
- tableOptions?: Record<string, unknown>;
12
- }
13
-
14
- export function markedTerminal(
15
- options?: MarkedTerminalOptions,
16
- highlightOptions?: Record<string, unknown>,
17
- ): MarkedExtension;
18
-
19
- export default class Renderer {}
20
- }