@compilr-dev/cli 0.5.15 → 0.5.17
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/dist/.tsbuildinfo.app +1 -1
- package/dist/.tsbuildinfo.data +1 -1
- package/dist/.tsbuildinfo.domain +1 -1
- package/dist/.tsbuildinfo.foundation +1 -1
- package/dist/agent.d.ts +4 -0
- package/dist/agent.js +32 -157
- package/dist/agents/registry.js +5 -4
- package/dist/auth/index.js +3 -3
- package/dist/commands/custom-registry.js +4 -3
- package/dist/compilr-diff-companion.vsix +0 -0
- package/dist/foundation/logger.d.ts +9 -0
- package/dist/foundation/logger.js +16 -0
- package/dist/repl-v2.js +4 -3
- package/dist/settings/index.js +2 -1
- package/dist/settings/paths.js +2 -1
- package/dist/shared-handlers.d.ts +2 -32
- package/dist/tools/ask-user-simple.d.ts +4 -15
- package/dist/tools/ask-user-simple.js +10 -82
- package/dist/tools/ask-user.d.ts +5 -28
- package/dist/tools/ask-user.js +10 -109
- package/dist/tools/db-tools.d.ts +1 -1
- package/dist/tools/platform-adapter.d.ts +1 -1
- package/dist/ui/terminal-renderer.js +2 -2
- package/dist/utils/credentials.js +6 -3
- package/package.json +5 -4
package/dist/tools/ask-user.d.ts
CHANGED
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Ask User Tool
|
|
2
|
+
* Ask User Tool — CLI wrapper around SDK factory
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Note: This tool uses a callback pattern to coordinate with the footer.
|
|
8
|
-
* The actual overlay is shown via getAskUserHandler() from shared-handlers.ts
|
|
9
|
-
* which is registered during app initialization and properly pauses the footer.
|
|
4
|
+
* Uses getAskUserHandler() from shared-handlers.ts which coordinates
|
|
5
|
+
* with the terminal footer (pause/resume) and shows the overlay.
|
|
10
6
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
id: string;
|
|
14
|
-
/** Short label for tab display (e.g., "App Type", "Users") - max 12 chars */
|
|
15
|
-
header: string;
|
|
16
|
-
/** The question text */
|
|
17
|
-
question: string;
|
|
18
|
-
/** Predefined options (optional) */
|
|
19
|
-
options?: string[];
|
|
20
|
-
/** Allow free-text input (default: true) */
|
|
21
|
-
allowCustom?: boolean;
|
|
22
|
-
/** Allow multiple selections (default: false) */
|
|
23
|
-
multiSelect?: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface AskUserInput {
|
|
26
|
-
/** 1-5 questions to ask */
|
|
27
|
-
questions: AskUserQuestion[];
|
|
28
|
-
/** Optional context shown above questions */
|
|
29
|
-
context?: string;
|
|
30
|
-
}
|
|
7
|
+
import { type AskUserInput } from '@compilr-dev/sdk';
|
|
8
|
+
export type { AskUserQuestion } from '@compilr-dev/sdk';
|
|
31
9
|
export declare const askUserTool: import("@compilr-dev/sdk").Tool<AskUserInput>;
|
|
32
|
-
export {};
|
package/dist/tools/ask-user.js
CHANGED
|
@@ -1,114 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Ask User Tool
|
|
2
|
+
* Ask User Tool — CLI wrapper around SDK factory
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Note: This tool uses a callback pattern to coordinate with the footer.
|
|
8
|
-
* The actual overlay is shown via getAskUserHandler() from shared-handlers.ts
|
|
9
|
-
* which is registered during app initialization and properly pauses the footer.
|
|
4
|
+
* Uses getAskUserHandler() from shared-handlers.ts which coordinates
|
|
5
|
+
* with the terminal footer (pause/resume) and shows the overlay.
|
|
10
6
|
*/
|
|
11
|
-
import {
|
|
7
|
+
import { createAskUserTool } from '@compilr-dev/sdk';
|
|
12
8
|
import { getAskUserHandler } from '../shared-handlers.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'Present 1-5 questions with optional predefined answers. ' +
|
|
20
|
-
'Each question can have options to choose from or allow free-text input. ' +
|
|
21
|
-
'Use this during design/refine phases to gather requirements efficiently.',
|
|
22
|
-
inputSchema: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {
|
|
25
|
-
questions: {
|
|
26
|
-
type: 'array',
|
|
27
|
-
description: 'Questions to ask the user (1-5 questions)',
|
|
28
|
-
minItems: 1,
|
|
29
|
-
maxItems: 5,
|
|
30
|
-
items: {
|
|
31
|
-
type: 'object',
|
|
32
|
-
properties: {
|
|
33
|
-
id: {
|
|
34
|
-
type: 'string',
|
|
35
|
-
description: 'Unique identifier for the question',
|
|
36
|
-
},
|
|
37
|
-
header: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
description: 'Short label for tab display (max 12 chars)',
|
|
40
|
-
},
|
|
41
|
-
question: {
|
|
42
|
-
type: 'string',
|
|
43
|
-
description: 'The question text',
|
|
44
|
-
},
|
|
45
|
-
options: {
|
|
46
|
-
type: 'array',
|
|
47
|
-
description: 'Predefined options (optional)',
|
|
48
|
-
items: { type: 'string' },
|
|
49
|
-
},
|
|
50
|
-
allowCustom: {
|
|
51
|
-
type: 'boolean',
|
|
52
|
-
description: 'Allow free-text input (default: true)',
|
|
53
|
-
},
|
|
54
|
-
multiSelect: {
|
|
55
|
-
type: 'boolean',
|
|
56
|
-
description: 'Allow multiple selections (default: false)',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
required: ['id', 'header', 'question'],
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
context: {
|
|
63
|
-
type: 'string',
|
|
64
|
-
description: 'Optional context shown above questions',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
required: ['questions'],
|
|
68
|
-
},
|
|
69
|
-
execute: async (input) => {
|
|
70
|
-
try {
|
|
71
|
-
// Validate input
|
|
72
|
-
if (input.questions.length === 0) {
|
|
73
|
-
return {
|
|
74
|
-
success: false,
|
|
75
|
-
error: 'At least one question is required',
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
if (input.questions.length > 5) {
|
|
79
|
-
return {
|
|
80
|
-
success: false,
|
|
81
|
-
error: 'Maximum 5 questions allowed',
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
// Get the handler from index.ts which coordinates with footer
|
|
85
|
-
const askUserHandler = getAskUserHandler();
|
|
86
|
-
if (!askUserHandler) {
|
|
87
|
-
return {
|
|
88
|
-
success: false,
|
|
89
|
-
error: 'ask_user handler not initialized. This tool requires the CLI context.',
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
// Show the overlay via the handler (which pauses footer)
|
|
93
|
-
const result = await askUserHandler({
|
|
94
|
-
questions: input.questions,
|
|
95
|
-
context: input.context,
|
|
96
|
-
});
|
|
97
|
-
const output = {
|
|
98
|
-
answers: result.answers,
|
|
99
|
-
skipped: result.skipped,
|
|
100
|
-
};
|
|
101
|
-
return {
|
|
102
|
-
success: true,
|
|
103
|
-
result: output,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
catch (err) {
|
|
107
|
-
return {
|
|
108
|
-
success: false,
|
|
109
|
-
error: `Failed to ask user: ${err instanceof Error ? err.message : String(err)}`,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
silent: true,
|
|
9
|
+
export const askUserTool = createAskUserTool(async (input) => {
|
|
10
|
+
const handler = getAskUserHandler();
|
|
11
|
+
if (!handler) {
|
|
12
|
+
throw new Error('ask_user handler not initialized. This tool requires the CLI context.');
|
|
13
|
+
}
|
|
14
|
+
return handler(input);
|
|
114
15
|
});
|
package/dist/tools/db-tools.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { getActiveProject, setActiveProject } from './project-db.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* All database tools combined (32 tools from SDK)
|
|
12
12
|
*/
|
|
13
|
-
export declare const allDbTools: import("@compilr-dev/
|
|
13
|
+
export declare const allDbTools: import("@compilr-dev/sdk").Tool<never>[];
|
|
14
14
|
/**
|
|
15
15
|
* All factory tools (5 tools from @compilr-dev/factory)
|
|
16
16
|
*/
|
|
@@ -22,4 +22,4 @@ export declare const allPlatformTools: import("@compilr-dev/sdk").Tool<never>[];
|
|
|
22
22
|
* - 3 model tools (app_model_get, app_model_update, app_model_validate)
|
|
23
23
|
* - 2 factory tools (factory_scaffold, factory_list_toolkits)
|
|
24
24
|
*/
|
|
25
|
-
export declare const allFactoryTools: import("@compilr-dev/
|
|
25
|
+
export declare const allFactoryTools: import("@compilr-dev/agents").Tool<never>[];
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* Single point of terminal output. All rendering goes through this class.
|
|
12
12
|
* Eliminates race conditions by ensuring only one writer.
|
|
13
13
|
*/
|
|
14
|
+
import { log } from '../foundation/logger.js';
|
|
14
15
|
import { EventEmitter } from 'events';
|
|
15
16
|
import { RenderMode, isValidTransition } from './render-modes.js';
|
|
16
17
|
// Re-export RenderMode for convenience
|
|
@@ -721,8 +722,7 @@ export class TerminalRenderer extends EventEmitter {
|
|
|
721
722
|
*/
|
|
722
723
|
log(message) {
|
|
723
724
|
if (this.debug) {
|
|
724
|
-
|
|
725
|
-
console.error(`[TerminalRenderer ${timestamp}] ${message}`);
|
|
725
|
+
log.debug({ component: 'terminal-renderer' }, message);
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
728
|
}
|
|
@@ -54,13 +54,16 @@ function getMasterKey() {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* Derive encryption key from master key +
|
|
57
|
+
* Derive encryption key from master key + username.
|
|
58
|
+
* NOTE: hostname was removed from derivation because Docker/devcontainers
|
|
59
|
+
* generate random hostnames on each rebuild, breaking credential decryption.
|
|
60
|
+
* The mk is a 32-byte random value unique per installation — sufficient entropy.
|
|
58
61
|
*/
|
|
59
62
|
function deriveKey() {
|
|
60
63
|
const mk = getMasterKey();
|
|
61
|
-
const
|
|
64
|
+
const userId = os.userInfo().username;
|
|
62
65
|
// Use scrypt for key derivation (secure, slow by design)
|
|
63
|
-
return crypto.scryptSync(`${mk}:${
|
|
66
|
+
return crypto.scryptSync(`${mk}:${userId}`, SALT, 32);
|
|
64
67
|
}
|
|
65
68
|
// =============================================================================
|
|
66
69
|
// Encryption/Decryption
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compilr-dev/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.17",
|
|
4
4
|
"description": "AI-powered coding assistant CLI using @compilr-dev/agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,15 +50,16 @@
|
|
|
50
50
|
"LICENSE"
|
|
51
51
|
],
|
|
52
52
|
"engines": {
|
|
53
|
-
"node": ">=
|
|
53
|
+
"node": ">=22.0.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@anthropic-ai/sdk": "^0.74.0",
|
|
57
57
|
"@compilr-dev/agents": "^0.3.26",
|
|
58
58
|
"@compilr-dev/agents-coding": "^1.0.4",
|
|
59
59
|
"@compilr-dev/editor-core": "^0.0.2",
|
|
60
|
-
"@compilr-dev/factory": "^0.1.
|
|
61
|
-
"@compilr-dev/
|
|
60
|
+
"@compilr-dev/factory": "^0.1.19",
|
|
61
|
+
"@compilr-dev/logger": "^0.1.0",
|
|
62
|
+
"@compilr-dev/sdk": "^0.7.1",
|
|
62
63
|
"@compilr-dev/ui-core": "^0.0.1",
|
|
63
64
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
64
65
|
"better-sqlite3": "^12.5.0",
|