@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.
- package/README.md +1 -48
- package/package.json +2 -10
- package/src/commands/dynamic.ts +0 -1
- package/src/graphql/generated/gql.ts +3 -33
- package/src/graphql/generated/graphql.ts +420 -559
- package/src/graphql/operations/common.ts +0 -82
- package/src/index.ts +0 -11
- package/src/commands/chat/chat.ts +0 -302
- package/src/commands/chat/interactive/App.tsx +0 -119
- package/src/commands/chat/interactive/components/ChatInput.tsx +0 -115
- package/src/commands/chat/interactive/components/ChoicePrompt.tsx +0 -35
- package/src/commands/chat/interactive/components/MessageView.tsx +0 -63
- package/src/commands/chat/interactive/components/ThinkingBox.tsx +0 -54
- package/src/commands/chat/interactive/connection.ts +0 -111
- package/src/commands/chat/interactive/debug-log.ts +0 -19
- package/src/commands/chat/interactive/hooks/useChat.ts +0 -440
- package/src/commands/chat/interactive/hooks/useTerminalSize.ts +0 -23
- package/src/commands/chat/interactive/index.tsx +0 -26
- package/src/commands/chat/interactive/markdown.ts +0 -29
- package/src/commands/chat/interactive/types.ts +0 -34
- package/src/types/marked-terminal.d.ts +0 -20
package/README.md
CHANGED
|
@@ -42,7 +42,6 @@ Every query and mutation from the federated GraphQL schema is available as a CLI
|
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
sl atlas <operation> # company and contact enrichment
|
|
45
|
-
sl chat <operation> # AI assistant (conversations, messages, configuration)
|
|
46
45
|
sl marketplace <operation> # agencies, projects, opportunities, quotes
|
|
47
46
|
sl hermes <operation> # OAuth/auth operations
|
|
48
47
|
```
|
|
@@ -72,52 +71,6 @@ sl schema refresh
|
|
|
72
71
|
|
|
73
72
|
The endpoint can be configured via `--endpoint`, `SL_ENDPOINT` env var, or `~/.sortlist/config.json`.
|
|
74
73
|
|
|
75
|
-
## Interactive chat
|
|
76
|
-
|
|
77
|
-
The `chat conversation` command is a hand-written interactive chat client (not auto-generated). It replaces the auto-generated basic `conversation` sub-command on the `chat` service.
|
|
78
|
-
|
|
79
|
-
### Basic mode
|
|
80
|
-
|
|
81
|
-
Plain readline-based chat with streaming responses:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
sl chat conversation # new conversation
|
|
85
|
-
sl chat conversation --conversation-id <id> # resume existing conversation
|
|
86
|
-
sl chat conversation --title "Debug session" # new conversation with title
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Interactive mode
|
|
90
|
-
|
|
91
|
-
Rich terminal UI with markdown rendering, thinking/tool-call visualization, and spinners:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
sl chat conversation -i # new conversation
|
|
95
|
-
sl chat conversation -i --conversation-id <id> # resume existing conversation
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Interactive mode features:
|
|
99
|
-
|
|
100
|
-
- Markdown rendering of assistant responses
|
|
101
|
-
- Thinking box showing tool calls with animated spinners
|
|
102
|
-
- Event reordering via sequence buffer (handles out-of-order WebSocket delivery)
|
|
103
|
-
- `/quit` or Ctrl+C to exit
|
|
104
|
-
|
|
105
|
-
## Debug logs
|
|
106
|
-
|
|
107
|
-
The interactive chat writes debug logs to files in the `cli/` directory (both gitignored):
|
|
108
|
-
|
|
109
|
-
| File | Contents |
|
|
110
|
-
| ----------------- | ------------------------------------------------------------------------ |
|
|
111
|
-
| `debug.log` | Raw WebSocket events, sequence buffer warnings, finalization diagnostics |
|
|
112
|
-
| `debug-tools.log` | Tool call arguments and full tool results |
|
|
113
|
-
|
|
114
|
-
Logs are cleared automatically when a new conversation starts.
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
tail -f debug.log # watch WebSocket events in real time
|
|
118
|
-
cat debug-tools.log # review tool calls and results
|
|
119
|
-
```
|
|
120
|
-
|
|
121
74
|
## Global options
|
|
122
75
|
|
|
123
76
|
| Flag | Description |
|
|
@@ -130,7 +83,7 @@ The endpoint can also be set via the `SL_ENDPOINT` environment variable or `~/.s
|
|
|
130
83
|
|
|
131
84
|
## Code generation
|
|
132
85
|
|
|
133
|
-
The only build-time step is `npm run codegen`, which generates TypeScript types for hand-written operations (auth flow
|
|
86
|
+
The only build-time step is `npm run codegen`, which generates TypeScript types for hand-written operations (auth flow) using `graphql-codegen`. It reads the schema from `../backend/supergraph.graphql`.
|
|
134
87
|
|
|
135
88
|
```bash
|
|
136
89
|
npm run generate # alias for npm run codegen
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sortlist/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Sortlist platform CLI — GraphQL federation client
|
|
3
|
+
"version": "0.31.0",
|
|
4
|
+
"description": "Sortlist platform CLI — GraphQL federation client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -29,14 +29,8 @@
|
|
|
29
29
|
"@graphql-codegen/cli": "^6.2.1",
|
|
30
30
|
"@graphql-codegen/client-preset": "^5.2.4",
|
|
31
31
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
32
|
-
"@inkjs/ui": "^2.0.0",
|
|
33
|
-
"@types/react": "^19.2.14",
|
|
34
32
|
"commander": "^13.0.0",
|
|
35
33
|
"graphql": "^16.13.2",
|
|
36
|
-
"ink": "^5.2.1",
|
|
37
|
-
"marked": "^15.0.12",
|
|
38
|
-
"marked-terminal": "^7.3.0",
|
|
39
|
-
"react": "^18.3.1",
|
|
40
34
|
"tsx": "^4.19.0"
|
|
41
35
|
},
|
|
42
36
|
"devDependencies": {
|
|
@@ -52,8 +46,6 @@
|
|
|
52
46
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
53
47
|
"eslint-plugin-import": "^2.29.1",
|
|
54
48
|
"eslint-plugin-prettier": "^5.1.3",
|
|
55
|
-
"eslint-plugin-react": "7.35.0",
|
|
56
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
57
49
|
"eslint-plugin-sonarjs": "^0.24.0",
|
|
58
50
|
"lefthook": "^1.11.5",
|
|
59
51
|
"prettier": "^3.5.3",
|
package/src/commands/dynamic.ts
CHANGED
|
@@ -467,7 +467,6 @@ const SERVICE_DESCRIPTIONS: Record<string, string> = {
|
|
|
467
467
|
atlas: 'Atlas service (contacts, orgs)',
|
|
468
468
|
marketplace: 'Marketplace service',
|
|
469
469
|
hermes: 'Hermes service',
|
|
470
|
-
// chat: 'Chat AI service (conversations)',
|
|
471
470
|
};
|
|
472
471
|
|
|
473
472
|
function serviceDescription(service: string): string {
|
|
@@ -14,26 +14,16 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-
|
|
|
14
14
|
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
|
|
15
15
|
*/
|
|
16
16
|
type Documents = {
|
|
17
|
-
"\n query Me {\n me {\n sub\n email\n firstName\n lastName\n companies {\n nodes {\n id\n name\n slug\n }\n }\n
|
|
18
|
-
"\n query Conversation($id: ID!) {\n node(id: $id) {\n ... on Conversation {\n id\n title\n status\n modelId\n createdAt\n updatedAt\n messages(last: 50) {\n nodes {\n id\n role\n content\n modelId\n inputTokens\n outputTokens\n createdAt\n }\n }\n }\n }\n }\n": typeof types.ConversationDocument,
|
|
19
|
-
"\n mutation SendMessage($input: SendMessageInput!) {\n sendMessage(input: $input) {\n id\n role\n content\n createdAt\n }\n }\n": typeof types.SendMessageDocument,
|
|
20
|
-
"\n mutation RespondToToolCall($input: RespondToToolCallInput!) {\n respondToToolCall(input: $input) {\n ok\n }\n }\n": typeof types.RespondToToolCallDocument,
|
|
21
|
-
"\n mutation CancelConversation($input: CancelConversationInput!) {\n cancelConversation(input: $input) {\n ok\n }\n }\n": typeof types.CancelConversationDocument,
|
|
17
|
+
"\n query Me {\n me {\n sub\n email\n firstName\n lastName\n companies {\n nodes {\n id\n name\n slug\n }\n }\n }\n }\n": typeof types.MeDocument,
|
|
22
18
|
"\n mutation CreateSalesOffer($input: CreateSalesOfferInput!) {\n createSalesOffer(input: $input) {\n inviteUrl\n offerId\n companyId\n }\n }\n": typeof types.CreateSalesOfferDocument,
|
|
23
|
-
"\n subscription ConversationEvent($conversationId: ID!) {\n conversationEvent(conversationId: $conversationId) {\n __typename\n agentLoopId\n agentLoopSequence\n ... on MessageChunkEvent { content }\n ... on ToolCallEvent { toolName toolCallId arguments }\n ... on ToolResultEvent { toolCallId content }\n ... on AgentPickedEvent { agent reason turn }\n ... on SupervisorVerdictEvent { verdict reason turn }\n ... on AgentLoopCompletedEvent { messageId }\n ... on AgentLoopFailedEvent { message }\n }\n }\n": typeof types.ConversationEventDocument,
|
|
24
19
|
"\n query LogoutUrl {\n logoutUrl\n }\n": typeof types.LogoutUrlDocument,
|
|
25
20
|
"\n mutation DeviceAuthorize($input: DeviceAuthorizeInput!) {\n deviceAuthorize(input: $input) {\n deviceCode\n expiresIn\n interval\n userCode\n verificationUri\n verificationUriComplete\n }\n }\n": typeof types.DeviceAuthorizeDocument,
|
|
26
21
|
"\n mutation DeviceToken($input: DeviceTokenInput!) {\n deviceToken(input: $input) {\n accessToken\n error\n expiresIn\n idToken\n refreshToken\n tokenType\n }\n }\n": typeof types.DeviceTokenDocument,
|
|
27
22
|
"\n mutation RefreshToken($input: RefreshTokenInput!) {\n refreshToken(input: $input) {\n accessToken\n error\n expiresIn\n idToken\n refreshToken\n tokenType\n }\n }\n": typeof types.RefreshTokenDocument,
|
|
28
23
|
};
|
|
29
24
|
const documents: Documents = {
|
|
30
|
-
"\n query Me {\n me {\n sub\n email\n firstName\n lastName\n companies {\n nodes {\n id\n name\n slug\n }\n }\n
|
|
31
|
-
"\n query Conversation($id: ID!) {\n node(id: $id) {\n ... on Conversation {\n id\n title\n status\n modelId\n createdAt\n updatedAt\n messages(last: 50) {\n nodes {\n id\n role\n content\n modelId\n inputTokens\n outputTokens\n createdAt\n }\n }\n }\n }\n }\n": types.ConversationDocument,
|
|
32
|
-
"\n mutation SendMessage($input: SendMessageInput!) {\n sendMessage(input: $input) {\n id\n role\n content\n createdAt\n }\n }\n": types.SendMessageDocument,
|
|
33
|
-
"\n mutation RespondToToolCall($input: RespondToToolCallInput!) {\n respondToToolCall(input: $input) {\n ok\n }\n }\n": types.RespondToToolCallDocument,
|
|
34
|
-
"\n mutation CancelConversation($input: CancelConversationInput!) {\n cancelConversation(input: $input) {\n ok\n }\n }\n": types.CancelConversationDocument,
|
|
25
|
+
"\n query Me {\n me {\n sub\n email\n firstName\n lastName\n companies {\n nodes {\n id\n name\n slug\n }\n }\n }\n }\n": types.MeDocument,
|
|
35
26
|
"\n mutation CreateSalesOffer($input: CreateSalesOfferInput!) {\n createSalesOffer(input: $input) {\n inviteUrl\n offerId\n companyId\n }\n }\n": types.CreateSalesOfferDocument,
|
|
36
|
-
"\n subscription ConversationEvent($conversationId: ID!) {\n conversationEvent(conversationId: $conversationId) {\n __typename\n agentLoopId\n agentLoopSequence\n ... on MessageChunkEvent { content }\n ... on ToolCallEvent { toolName toolCallId arguments }\n ... on ToolResultEvent { toolCallId content }\n ... on AgentPickedEvent { agent reason turn }\n ... on SupervisorVerdictEvent { verdict reason turn }\n ... on AgentLoopCompletedEvent { messageId }\n ... on AgentLoopFailedEvent { message }\n }\n }\n": types.ConversationEventDocument,
|
|
37
27
|
"\n query LogoutUrl {\n logoutUrl\n }\n": types.LogoutUrlDocument,
|
|
38
28
|
"\n mutation DeviceAuthorize($input: DeviceAuthorizeInput!) {\n deviceAuthorize(input: $input) {\n deviceCode\n expiresIn\n interval\n userCode\n verificationUri\n verificationUriComplete\n }\n }\n": types.DeviceAuthorizeDocument,
|
|
39
29
|
"\n mutation DeviceToken($input: DeviceTokenInput!) {\n deviceToken(input: $input) {\n accessToken\n error\n expiresIn\n idToken\n refreshToken\n tokenType\n }\n }\n": types.DeviceTokenDocument,
|
|
@@ -57,31 +47,11 @@ export function gql(source: string): unknown;
|
|
|
57
47
|
/**
|
|
58
48
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
59
49
|
*/
|
|
60
|
-
export function gql(source: "\n query Me {\n me {\n sub\n email\n firstName\n lastName\n companies {\n nodes {\n id\n name\n slug\n }\n }\n
|
|
61
|
-
/**
|
|
62
|
-
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
63
|
-
*/
|
|
64
|
-
export function gql(source: "\n query Conversation($id: ID!) {\n node(id: $id) {\n ... on Conversation {\n id\n title\n status\n modelId\n createdAt\n updatedAt\n messages(last: 50) {\n nodes {\n id\n role\n content\n modelId\n inputTokens\n outputTokens\n createdAt\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query Conversation($id: ID!) {\n node(id: $id) {\n ... on Conversation {\n id\n title\n status\n modelId\n createdAt\n updatedAt\n messages(last: 50) {\n nodes {\n id\n role\n content\n modelId\n inputTokens\n outputTokens\n createdAt\n }\n }\n }\n }\n }\n"];
|
|
65
|
-
/**
|
|
66
|
-
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
67
|
-
*/
|
|
68
|
-
export function gql(source: "\n mutation SendMessage($input: SendMessageInput!) {\n sendMessage(input: $input) {\n id\n role\n content\n createdAt\n }\n }\n"): (typeof documents)["\n mutation SendMessage($input: SendMessageInput!) {\n sendMessage(input: $input) {\n id\n role\n content\n createdAt\n }\n }\n"];
|
|
69
|
-
/**
|
|
70
|
-
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
71
|
-
*/
|
|
72
|
-
export function gql(source: "\n mutation RespondToToolCall($input: RespondToToolCallInput!) {\n respondToToolCall(input: $input) {\n ok\n }\n }\n"): (typeof documents)["\n mutation RespondToToolCall($input: RespondToToolCallInput!) {\n respondToToolCall(input: $input) {\n ok\n }\n }\n"];
|
|
73
|
-
/**
|
|
74
|
-
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
75
|
-
*/
|
|
76
|
-
export function gql(source: "\n mutation CancelConversation($input: CancelConversationInput!) {\n cancelConversation(input: $input) {\n ok\n }\n }\n"): (typeof documents)["\n mutation CancelConversation($input: CancelConversationInput!) {\n cancelConversation(input: $input) {\n ok\n }\n }\n"];
|
|
50
|
+
export function gql(source: "\n query Me {\n me {\n sub\n email\n firstName\n lastName\n companies {\n nodes {\n id\n name\n slug\n }\n }\n }\n }\n"): (typeof documents)["\n query Me {\n me {\n sub\n email\n firstName\n lastName\n companies {\n nodes {\n id\n name\n slug\n }\n }\n }\n }\n"];
|
|
77
51
|
/**
|
|
78
52
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
79
53
|
*/
|
|
80
54
|
export function gql(source: "\n mutation CreateSalesOffer($input: CreateSalesOfferInput!) {\n createSalesOffer(input: $input) {\n inviteUrl\n offerId\n companyId\n }\n }\n"): (typeof documents)["\n mutation CreateSalesOffer($input: CreateSalesOfferInput!) {\n createSalesOffer(input: $input) {\n inviteUrl\n offerId\n companyId\n }\n }\n"];
|
|
81
|
-
/**
|
|
82
|
-
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
83
|
-
*/
|
|
84
|
-
export function gql(source: "\n subscription ConversationEvent($conversationId: ID!) {\n conversationEvent(conversationId: $conversationId) {\n __typename\n agentLoopId\n agentLoopSequence\n ... on MessageChunkEvent { content }\n ... on ToolCallEvent { toolName toolCallId arguments }\n ... on ToolResultEvent { toolCallId content }\n ... on AgentPickedEvent { agent reason turn }\n ... on SupervisorVerdictEvent { verdict reason turn }\n ... on AgentLoopCompletedEvent { messageId }\n ... on AgentLoopFailedEvent { message }\n }\n }\n"): (typeof documents)["\n subscription ConversationEvent($conversationId: ID!) {\n conversationEvent(conversationId: $conversationId) {\n __typename\n agentLoopId\n agentLoopSequence\n ... on MessageChunkEvent { content }\n ... on ToolCallEvent { toolName toolCallId arguments }\n ... on ToolResultEvent { toolCallId content }\n ... on AgentPickedEvent { agent reason turn }\n ... on SupervisorVerdictEvent { verdict reason turn }\n ... on AgentLoopCompletedEvent { messageId }\n ... on AgentLoopFailedEvent { message }\n }\n }\n"];
|
|
85
55
|
/**
|
|
86
56
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
87
57
|
*/
|