@codemieai/code 0.0.2 → 0.0.4
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 +357 -719
- package/bin/codemie-claude.js +145 -0
- package/bin/codemie-code.js +128 -15
- package/bin/codemie-codex.js +137 -0
- package/bin/codemie.js +1 -1
- package/dist/agents/adapters/claude-code.d.ts +7 -2
- package/dist/agents/adapters/claude-code.d.ts.map +1 -1
- package/dist/agents/adapters/claude-code.js +94 -58
- package/dist/agents/adapters/claude-code.js.map +1 -1
- package/dist/agents/adapters/codemie-code.d.ts +11 -2
- package/dist/agents/adapters/codemie-code.d.ts.map +1 -1
- package/dist/agents/adapters/codemie-code.js +93 -25
- package/dist/agents/adapters/codemie-code.js.map +1 -1
- package/dist/agents/adapters/codex.d.ts +7 -2
- package/dist/agents/adapters/codex.d.ts.map +1 -1
- package/dist/agents/adapters/codex.js +104 -39
- package/dist/agents/adapters/codex.js.map +1 -1
- package/dist/agents/codemie-code/agent.d.ts +89 -0
- package/dist/agents/codemie-code/agent.d.ts.map +1 -0
- package/dist/agents/codemie-code/agent.js +689 -0
- package/dist/agents/codemie-code/agent.js.map +1 -0
- package/dist/agents/codemie-code/config.d.ts +40 -0
- package/dist/agents/codemie-code/config.d.ts.map +1 -0
- package/dist/agents/codemie-code/config.js +278 -0
- package/dist/agents/codemie-code/config.js.map +1 -0
- package/dist/agents/codemie-code/filters.d.ts +91 -0
- package/dist/agents/codemie-code/filters.d.ts.map +1 -0
- package/dist/agents/codemie-code/filters.js +328 -0
- package/dist/agents/codemie-code/filters.js.map +1 -0
- package/dist/agents/codemie-code/index.d.ts +92 -0
- package/dist/agents/codemie-code/index.d.ts.map +1 -0
- package/dist/agents/codemie-code/index.js +327 -0
- package/dist/agents/codemie-code/index.js.map +1 -0
- package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts +87 -0
- package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts.map +1 -0
- package/dist/agents/codemie-code/modes/contextAwarePlanning.js +957 -0
- package/dist/agents/codemie-code/modes/contextAwarePlanning.js.map +1 -0
- package/dist/agents/codemie-code/modes/planMode.d.ts +116 -0
- package/dist/agents/codemie-code/modes/planMode.d.ts.map +1 -0
- package/dist/agents/codemie-code/modes/planMode.js +537 -0
- package/dist/agents/codemie-code/modes/planMode.js.map +1 -0
- package/dist/agents/codemie-code/prompts.d.ts +40 -0
- package/dist/agents/codemie-code/prompts.d.ts.map +1 -0
- package/dist/agents/codemie-code/prompts.js +160 -0
- package/dist/agents/codemie-code/prompts.js.map +1 -0
- package/dist/agents/codemie-code/storage/todoStorage.d.ts +78 -0
- package/dist/agents/codemie-code/storage/todoStorage.d.ts.map +1 -0
- package/dist/agents/codemie-code/storage/todoStorage.js +225 -0
- package/dist/agents/codemie-code/storage/todoStorage.js.map +1 -0
- package/dist/agents/codemie-code/tokenUtils.d.ts +108 -0
- package/dist/agents/codemie-code/tokenUtils.d.ts.map +1 -0
- package/dist/agents/codemie-code/tokenUtils.js +220 -0
- package/dist/agents/codemie-code/tokenUtils.js.map +1 -0
- package/dist/agents/codemie-code/toolMetadata.d.ts +15 -0
- package/dist/agents/codemie-code/toolMetadata.d.ts.map +1 -0
- package/dist/agents/codemie-code/toolMetadata.js +315 -0
- package/dist/agents/codemie-code/toolMetadata.js.map +1 -0
- package/dist/agents/codemie-code/tools/index.d.ts +45 -0
- package/dist/agents/codemie-code/tools/index.d.ts.map +1 -0
- package/dist/agents/codemie-code/tools/index.js +407 -0
- package/dist/agents/codemie-code/tools/index.js.map +1 -0
- package/dist/agents/codemie-code/tools/planning.d.ts +53 -0
- package/dist/agents/codemie-code/tools/planning.d.ts.map +1 -0
- package/dist/agents/codemie-code/tools/planning.js +224 -0
- package/dist/agents/codemie-code/tools/planning.js.map +1 -0
- package/dist/agents/codemie-code/types.d.ts +418 -0
- package/dist/agents/codemie-code/types.d.ts.map +1 -0
- package/dist/agents/codemie-code/types.js +35 -0
- package/dist/agents/codemie-code/types.js.map +1 -0
- package/dist/agents/codemie-code/ui/progressTracker.d.ts +125 -0
- package/dist/agents/codemie-code/ui/progressTracker.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/progressTracker.js +343 -0
- package/dist/agents/codemie-code/ui/progressTracker.js.map +1 -0
- package/dist/agents/codemie-code/ui/todoPanel.d.ts +112 -0
- package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/todoPanel.js +318 -0
- package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -0
- package/dist/agents/codemie-code/ui.d.ts +179 -0
- package/dist/agents/codemie-code/ui.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui.js +1408 -0
- package/dist/agents/codemie-code/ui.js.map +1 -0
- package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts +87 -0
- package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts.map +1 -0
- package/dist/agents/codemie-code/utils/progressionEnforcer.js +293 -0
- package/dist/agents/codemie-code/utils/progressionEnforcer.js.map +1 -0
- package/dist/agents/codemie-code/utils/todoParser.d.ts +41 -0
- package/dist/agents/codemie-code/utils/todoParser.d.ts.map +1 -0
- package/dist/agents/codemie-code/utils/todoParser.js +305 -0
- package/dist/agents/codemie-code/utils/todoParser.js.map +1 -0
- package/dist/agents/codemie-code/utils/todoValidator.d.ts +65 -0
- package/dist/agents/codemie-code/utils/todoValidator.d.ts.map +1 -0
- package/dist/agents/codemie-code/utils/todoValidator.js +249 -0
- package/dist/agents/codemie-code/utils/todoValidator.js.map +1 -0
- package/dist/agents/codemie-code/validators/planValidator.d.ts +94 -0
- package/dist/agents/codemie-code/validators/planValidator.d.ts.map +1 -0
- package/dist/agents/codemie-code/validators/planValidator.js +281 -0
- package/dist/agents/codemie-code/validators/planValidator.js.map +1 -0
- package/dist/agents/registry.d.ts +1 -1
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +11 -15
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/auth.d.ts +3 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +170 -0
- package/dist/cli/commands/auth.js.map +1 -0
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +350 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +308 -71
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/env.d.ts +3 -0
- package/dist/cli/commands/env.d.ts.map +1 -0
- package/dist/cli/commands/env.js +19 -0
- package/dist/cli/commands/env.js.map +1 -0
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +28 -33
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/list.js +18 -24
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +297 -31
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/setup.d.ts +3 -0
- package/dist/cli/commands/setup.d.ts.map +1 -0
- package/dist/cli/commands/setup.js +523 -0
- package/dist/cli/commands/setup.js.map +1 -0
- package/dist/cli/commands/tools.d.ts +6 -0
- package/dist/cli/commands/tools.d.ts.map +1 -0
- package/dist/cli/commands/tools.js +244 -0
- package/dist/cli/commands/tools.js.map +1 -0
- package/dist/cli/commands/uninstall.js +24 -30
- package/dist/cli/commands/uninstall.js.map +1 -1
- package/dist/cli/commands/version.d.ts.map +1 -1
- package/dist/cli/commands/version.js +11 -16
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts +6 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +424 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.js +85 -35
- package/dist/cli/index.js.map +1 -1
- package/dist/clients/adapters/github.d.ts +17 -0
- package/dist/clients/adapters/github.d.ts.map +1 -0
- package/dist/clients/adapters/github.js +150 -0
- package/dist/clients/adapters/github.js.map +1 -0
- package/dist/clients/adapters/gitlab.d.ts +17 -0
- package/dist/clients/adapters/gitlab.d.ts.map +1 -0
- package/dist/clients/adapters/gitlab.js +147 -0
- package/dist/clients/adapters/gitlab.js.map +1 -0
- package/dist/clients/registry.d.ts +20 -0
- package/dist/clients/registry.d.ts.map +1 -0
- package/dist/clients/registry.js +27 -0
- package/dist/clients/registry.js.map +1 -0
- package/dist/env/manager.js +9 -46
- package/dist/env/manager.js.map +1 -1
- package/dist/index.d.ts +6 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -43
- package/dist/index.js.map +1 -1
- package/dist/tools/detector.d.ts +33 -0
- package/dist/tools/detector.d.ts.map +1 -0
- package/dist/tools/detector.js +145 -0
- package/dist/tools/detector.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/manager.d.ts +21 -0
- package/dist/tools/manager.d.ts.map +1 -0
- package/dist/tools/manager.js +104 -0
- package/dist/tools/manager.js.map +1 -0
- package/dist/tools/registry.d.ts +8 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +36 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +41 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +5 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types/sso.d.ts +42 -0
- package/dist/types/sso.d.ts.map +1 -0
- package/dist/types/sso.js +2 -0
- package/dist/types/sso.js.map +1 -0
- package/dist/utils/agent-compatibility.d.ts +32 -0
- package/dist/utils/agent-compatibility.d.ts.map +1 -0
- package/dist/utils/agent-compatibility.js +140 -0
- package/dist/utils/agent-compatibility.js.map +1 -0
- package/dist/utils/async-tips.d.ts.map +1 -1
- package/dist/utils/async-tips.js +16 -55
- package/dist/utils/async-tips.js.map +1 -1
- package/dist/utils/clipboard.d.ts +16 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +179 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/codemie-integration-validator.d.ts +17 -0
- package/dist/utils/codemie-integration-validator.d.ts.map +1 -0
- package/dist/utils/codemie-integration-validator.js +105 -0
- package/dist/utils/codemie-integration-validator.js.map +1 -0
- package/dist/utils/codemie-model-fetcher.d.ts +11 -0
- package/dist/utils/codemie-model-fetcher.d.ts.map +1 -0
- package/dist/utils/codemie-model-fetcher.js +242 -0
- package/dist/utils/codemie-model-fetcher.js.map +1 -0
- package/dist/utils/config-loader.d.ts +118 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +397 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/credential-store.d.ts +16 -0
- package/dist/utils/credential-store.d.ts.map +1 -0
- package/dist/utils/credential-store.js +109 -0
- package/dist/utils/credential-store.js.map +1 -0
- package/dist/utils/dirname.d.ts +7 -0
- package/dist/utils/dirname.d.ts.map +1 -0
- package/dist/utils/dirname.js +11 -0
- package/dist/utils/dirname.js.map +1 -0
- package/dist/utils/errors.js +7 -17
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/exec.js +3 -6
- package/dist/utils/exec.js.map +1 -1
- package/dist/utils/first-time.d.ts +34 -0
- package/dist/utils/first-time.d.ts.map +1 -0
- package/dist/utils/first-time.js +226 -0
- package/dist/utils/first-time.js.map +1 -0
- package/dist/utils/health-checker.d.ts +20 -0
- package/dist/utils/health-checker.d.ts.map +1 -0
- package/dist/utils/health-checker.js +172 -0
- package/dist/utils/health-checker.js.map +1 -0
- package/dist/utils/logger.js +12 -18
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/model-fetcher.d.ts +21 -0
- package/dist/utils/model-fetcher.d.ts.map +1 -0
- package/dist/utils/model-fetcher.js +150 -0
- package/dist/utils/model-fetcher.js.map +1 -0
- package/dist/utils/sso-auth.d.ts +15 -0
- package/dist/utils/sso-auth.d.ts.map +1 -0
- package/dist/utils/sso-auth.js +207 -0
- package/dist/utils/sso-auth.js.map +1 -0
- package/dist/utils/sso-gateway.d.ts +47 -0
- package/dist/utils/sso-gateway.d.ts.map +1 -0
- package/dist/utils/sso-gateway.js +298 -0
- package/dist/utils/sso-gateway.js.map +1 -0
- package/dist/utils/tips.d.ts.map +1 -1
- package/dist/utils/tips.js +13 -52
- package/dist/utils/tips.js.map +1 -1
- package/dist/workflows/detector.d.ts +37 -0
- package/dist/workflows/detector.d.ts.map +1 -0
- package/dist/workflows/detector.js +160 -0
- package/dist/workflows/detector.js.map +1 -0
- package/dist/workflows/index.d.ts +8 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +8 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/installer.d.ts +24 -0
- package/dist/workflows/installer.d.ts.map +1 -0
- package/dist/workflows/installer.js +105 -0
- package/dist/workflows/installer.js.map +1 -0
- package/dist/workflows/registry.d.ts +29 -0
- package/dist/workflows/registry.d.ts.map +1 -0
- package/dist/workflows/registry.js +54 -0
- package/dist/workflows/registry.js.map +1 -0
- package/dist/workflows/templates/github/metadata.d.ts +6 -0
- package/dist/workflows/templates/github/metadata.d.ts.map +1 -0
- package/dist/workflows/templates/github/metadata.js +111 -0
- package/dist/workflows/templates/github/metadata.js.map +1 -0
- package/dist/workflows/templates/gitlab/metadata.d.ts +6 -0
- package/dist/workflows/templates/gitlab/metadata.d.ts.map +1 -0
- package/dist/workflows/templates/gitlab/metadata.js +14 -0
- package/dist/workflows/templates/gitlab/metadata.js.map +1 -0
- package/dist/workflows/types.d.ts +71 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/types.js +5 -0
- package/dist/workflows/types.js.map +1 -0
- package/package.json +32 -25
- package/src/workflows/templates/github/code-ci.yml +529 -0
- package/src/workflows/templates/github/inline-fix.yml +665 -0
- package/src/workflows/templates/github/pr-review.yml +677 -0
- package/.claude/agents/README.md +0 -298
- package/.claude/agents/release-manager.md +0 -857
- package/.codemie/guides/git-workflow.md +0 -493
- package/CLAUDE.md +0 -855
- package/dist/agents/adapters/aider.d.ts +0 -12
- package/dist/agents/adapters/aider.d.ts.map +0 -1
- package/dist/agents/adapters/aider.js +0 -80
- package/dist/agents/adapters/aider.js.map +0 -1
- package/dist/cli/cli.d.ts +0 -4
- package/dist/cli/cli.d.ts.map +0 -1
- package/dist/cli/cli.js +0 -107
- package/dist/cli/cli.js.map +0 -1
- package/dist/cli/commands/mcp.d.ts +0 -3
- package/dist/cli/commands/mcp.d.ts.map +0 -1
- package/dist/cli/commands/mcp.js +0 -459
- package/dist/cli/commands/mcp.js.map +0 -1
- package/dist/code/agent-events.d.ts +0 -39
- package/dist/code/agent-events.d.ts.map +0 -1
- package/dist/code/agent-events.js +0 -4
- package/dist/code/agent-events.js.map +0 -1
- package/dist/code/agent.d.ts +0 -19
- package/dist/code/agent.d.ts.map +0 -1
- package/dist/code/agent.js +0 -144
- package/dist/code/agent.js.map +0 -1
- package/dist/code/config.d.ts +0 -13
- package/dist/code/config.d.ts.map +0 -1
- package/dist/code/config.js +0 -41
- package/dist/code/config.js.map +0 -1
- package/dist/code/index.d.ts +0 -19
- package/dist/code/index.d.ts.map +0 -1
- package/dist/code/index.js +0 -400
- package/dist/code/index.js.map +0 -1
- package/dist/code/prompts.d.ts +0 -2
- package/dist/code/prompts.d.ts.map +0 -1
- package/dist/code/prompts.js +0 -45
- package/dist/code/prompts.js.map +0 -1
- package/dist/code/tools/command.d.ts +0 -8
- package/dist/code/tools/command.d.ts.map +0 -1
- package/dist/code/tools/command.js +0 -83
- package/dist/code/tools/command.js.map +0 -1
- package/dist/code/tools/diff-utils.d.ts +0 -2
- package/dist/code/tools/diff-utils.d.ts.map +0 -1
- package/dist/code/tools/diff-utils.js +0 -45
- package/dist/code/tools/diff-utils.js.map +0 -1
- package/dist/code/tools/filesystem.d.ts +0 -11
- package/dist/code/tools/filesystem.d.ts.map +0 -1
- package/dist/code/tools/filesystem.js +0 -442
- package/dist/code/tools/filesystem.js.map +0 -1
- package/dist/code/tools/git.d.ts +0 -7
- package/dist/code/tools/git.d.ts.map +0 -1
- package/dist/code/tools/git.js +0 -111
- package/dist/code/tools/git.js.map +0 -1
- package/dist/code/tools/mcp.d.ts +0 -13
- package/dist/code/tools/mcp.d.ts.map +0 -1
- package/dist/code/tools/mcp.js +0 -230
- package/dist/code/tools/mcp.js.map +0 -1
- package/dist/data/tips.json +0 -118
- package/dist/ui/terminal-ui.d.ts +0 -73
- package/dist/ui/terminal-ui.d.ts.map +0 -1
- package/dist/ui/terminal-ui.js +0 -900
- package/dist/ui/terminal-ui.js.map +0 -1
- package/dist/utils/env-mapper.d.ts +0 -40
- package/dist/utils/env-mapper.d.ts.map +0 -1
- package/dist/utils/env-mapper.js +0 -122
- package/dist/utils/env-mapper.js.map +0 -1
- package/docs/USER_GUIDE.md +0 -573
- package/eslint.config.mjs +0 -43
- package/tests/agent-direct.test.mjs +0 -45
- package/tests/agent-output.test.mjs +0 -64
- package/tests/codemie-code.test.mjs +0 -42
- package/tests/context7-only.test.mjs +0 -42
- package/tests/conversation-flow.test.mjs +0 -63
- package/tests/interactive-simulation.test.mjs +0 -60
- package/tests/live-output.test.mjs +0 -53
- package/tests/mcp-context7.test.mjs +0 -105
- package/tests/mcp-e2e.test.mjs +0 -109
- package/tests/mcp-time-server.test.mjs +0 -58
- package/tests/streaming.test.mjs +0 -57
- package/tests/test-helpers.mjs +0 -94
- package/tests/text-wrapping.test.mjs +0 -33
- package/tests/tool-count.test.mjs +0 -81
- package/tests/ui-format.test.mjs +0 -39
- package/tests/ui-state.test.mjs +0 -72
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Integration Test: Text wrapping
|
|
3
|
-
* Uses Node.js native test runner
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { describe, it } from 'node:test';
|
|
7
|
-
import assert from 'node:assert';
|
|
8
|
-
|
|
9
|
-
describe('Text Wrapping', () => {
|
|
10
|
-
it('should split long text into lines', () => {
|
|
11
|
-
const longText = `I'll list the files in the current directory (\`/Users/Nikita_Levyankov/repos/EPMCDME/codemie-tools\`):
|
|
12
|
-
|
|
13
|
-
**Directories:**
|
|
14
|
-
- \`.claude\` - Claude configuration
|
|
15
|
-
- \`src\` - Source code
|
|
16
|
-
- \`dist\` - Distribution files`;
|
|
17
|
-
|
|
18
|
-
const lines = longText.split('\n');
|
|
19
|
-
|
|
20
|
-
assert.ok(lines.length > 1, 'Should have multiple lines');
|
|
21
|
-
assert.ok(lines[0].includes('list the files'), 'First line should contain intro');
|
|
22
|
-
assert.ok(lines.some(l => l.includes('Directories')), 'Should contain Directories header');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should preserve markdown formatting in lines', () => {
|
|
26
|
-
const text = '**Directories:**\n- `.claude` - Claude configuration';
|
|
27
|
-
const lines = text.split('\n');
|
|
28
|
-
|
|
29
|
-
assert.ok(lines[0].includes('**'), 'Should preserve bold markdown');
|
|
30
|
-
assert.ok(lines[1].includes('`'), 'Should preserve code markdown');
|
|
31
|
-
assert.ok(lines[1].startsWith('- '), 'Should preserve list formatting');
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Integration Test: Verify MCP tools are loaded correctly
|
|
3
|
-
* Uses Node.js native test runner
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { describe, it, before, after } from 'node:test';
|
|
7
|
-
import assert from 'node:assert';
|
|
8
|
-
import { CodeMieCode } from '../dist/code/index.js';
|
|
9
|
-
import { skipIfNoBaseUrl } from './test-helpers.mjs';
|
|
10
|
-
|
|
11
|
-
describe('Tool Loading', () => {
|
|
12
|
-
let assistant;
|
|
13
|
-
|
|
14
|
-
before(async () => {
|
|
15
|
-
if (skipIfNoBaseUrl()) return;
|
|
16
|
-
|
|
17
|
-
assistant = new CodeMieCode(process.cwd());
|
|
18
|
-
await assistant.initialize({ showTips: false });
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
after(async () => {
|
|
22
|
-
if (assistant) {
|
|
23
|
-
await assistant.dispose();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('should load all tools', () => {
|
|
28
|
-
if (skipIfNoBaseUrl()) return;
|
|
29
|
-
const agent = assistant.agent;
|
|
30
|
-
const tools = agent.tools;
|
|
31
|
-
|
|
32
|
-
assert.ok(tools, 'Tools should be defined');
|
|
33
|
-
assert.ok(tools.length > 0, 'Should have loaded tools');
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should load tools by category', () => {
|
|
37
|
-
if (skipIfNoBaseUrl()) return;
|
|
38
|
-
const agent = assistant.agent;
|
|
39
|
-
const tools = agent.tools;
|
|
40
|
-
|
|
41
|
-
const toolTypes = {
|
|
42
|
-
filesystem: [],
|
|
43
|
-
command: [],
|
|
44
|
-
git: [],
|
|
45
|
-
mcp: [],
|
|
46
|
-
other: []
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
tools.forEach(tool => {
|
|
50
|
-
if (tool.name.startsWith('mcp_')) {
|
|
51
|
-
toolTypes.mcp.push(tool);
|
|
52
|
-
} else if (tool.name.includes('file') || tool.name.includes('directory') || tool.name.includes('read') || tool.name.includes('write')) {
|
|
53
|
-
toolTypes.filesystem.push(tool);
|
|
54
|
-
} else if (tool.name.includes('command') || tool.name.includes('execute')) {
|
|
55
|
-
toolTypes.command.push(tool);
|
|
56
|
-
} else if (tool.name.includes('git')) {
|
|
57
|
-
toolTypes.git.push(tool);
|
|
58
|
-
} else {
|
|
59
|
-
toolTypes.other.push(tool);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
assert.ok(toolTypes.filesystem.length >= 8, `Expected >= 8 filesystem tools, got ${toolTypes.filesystem.length}`);
|
|
64
|
-
assert.ok(toolTypes.command.length >= 2, `Expected >= 2 command tools, got ${toolTypes.command.length}`);
|
|
65
|
-
assert.ok(toolTypes.git.length >= 3, `Expected >= 3 git tools, got ${toolTypes.git.length}`);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should load MCP tools from context7', () => {
|
|
69
|
-
if (skipIfNoBaseUrl()) return;
|
|
70
|
-
const agent = assistant.agent;
|
|
71
|
-
const tools = agent.tools;
|
|
72
|
-
|
|
73
|
-
const mcpTools = tools.filter(tool => tool.name.startsWith('mcp_'));
|
|
74
|
-
|
|
75
|
-
assert.ok(mcpTools.length >= 2, `Expected >= 2 MCP tools, got ${mcpTools.length}`);
|
|
76
|
-
|
|
77
|
-
const toolNames = mcpTools.map(t => t.name);
|
|
78
|
-
assert.ok(toolNames.includes('mcp_resolve-library-id'), 'Should have mcp_resolve-library-id');
|
|
79
|
-
assert.ok(toolNames.includes('mcp_get-library-docs'), 'Should have mcp_get-library-docs');
|
|
80
|
-
});
|
|
81
|
-
});
|
package/tests/ui-format.test.mjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Integration Test: UI formatting
|
|
3
|
-
* Uses Node.js native test runner
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { describe, it } from 'node:test';
|
|
7
|
-
import assert from 'node:assert';
|
|
8
|
-
|
|
9
|
-
describe('UI Format', () => {
|
|
10
|
-
it('should format tool calls correctly', () => {
|
|
11
|
-
const toolName = 'Bash';
|
|
12
|
-
const toolArgs = { command: 'ls -la' };
|
|
13
|
-
const formatted = `⏺ ${toolName}(${JSON.stringify(toolArgs)})`;
|
|
14
|
-
|
|
15
|
-
assert.ok(formatted.includes('⏺'), 'Should include bullet point');
|
|
16
|
-
assert.ok(formatted.includes('Bash'), 'Should include tool name');
|
|
17
|
-
assert.ok(formatted.includes('ls -la'), 'Should include arguments');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should format tool results with indentation', () => {
|
|
21
|
-
const result = 'total 672\ndrwxr-xr-x@ 21 Nikita_Levyankov';
|
|
22
|
-
const lines = result.split('\n');
|
|
23
|
-
const formatted = ` ⎿ ${lines[0]}`;
|
|
24
|
-
|
|
25
|
-
assert.ok(formatted.includes('⎿'), 'Should include corner symbol');
|
|
26
|
-
assert.ok(formatted.startsWith(' '), 'Should be indented');
|
|
27
|
-
assert.ok(formatted.includes('total 672'), 'Should include result content');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('should truncate long multi-line results', () => {
|
|
31
|
-
const result = Array(20).fill('line').join('\n');
|
|
32
|
-
const lines = result.split('\n');
|
|
33
|
-
const displayLines = lines.slice(0, 3);
|
|
34
|
-
const hiddenLines = Math.max(0, lines.length - 3);
|
|
35
|
-
|
|
36
|
-
assert.strictEqual(displayLines.length, 3, 'Should show only 3 lines');
|
|
37
|
-
assert.strictEqual(hiddenLines, 17, 'Should hide 17 lines');
|
|
38
|
-
});
|
|
39
|
-
});
|
package/tests/ui-state.test.mjs
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Integration Test: UI state management
|
|
3
|
-
* Uses Node.js native test runner
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { describe, it, before, after } from 'node:test';
|
|
7
|
-
import assert from 'node:assert';
|
|
8
|
-
import { CodeMieCode } from '../dist/code/index.js';
|
|
9
|
-
import { skipIfNoBaseUrl } from './test-helpers.mjs';
|
|
10
|
-
|
|
11
|
-
describe('UI State Management', () => {
|
|
12
|
-
let assistant;
|
|
13
|
-
|
|
14
|
-
before(async () => {
|
|
15
|
-
if (skipIfNoBaseUrl()) return;
|
|
16
|
-
|
|
17
|
-
assistant = new CodeMieCode(process.cwd());
|
|
18
|
-
await assistant.initialize({ showTips: false });
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
after(async () => {
|
|
22
|
-
if (assistant) {
|
|
23
|
-
await assistant.dispose();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('should handle consecutive messages without blocking', async () => {
|
|
28
|
-
if (skipIfNoBaseUrl()) return;
|
|
29
|
-
const mockUIState = {
|
|
30
|
-
isProcessing: false,
|
|
31
|
-
inputEnabled: true
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const questions = [
|
|
35
|
-
'What is 2+2?',
|
|
36
|
-
'What is the capital of France?',
|
|
37
|
-
'List files in current directory'
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
let messageCount = 0;
|
|
41
|
-
|
|
42
|
-
for (let i = 0; i < questions.length; i++) {
|
|
43
|
-
const question = questions[i];
|
|
44
|
-
|
|
45
|
-
// Check if processing (simulating UI check)
|
|
46
|
-
assert.strictEqual(mockUIState.isProcessing, false, `Should not be processing before question ${i + 1}`);
|
|
47
|
-
|
|
48
|
-
// Set processing flag (like the UI does)
|
|
49
|
-
mockUIState.isProcessing = true;
|
|
50
|
-
mockUIState.inputEnabled = false;
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
// Call the agent
|
|
54
|
-
await assistant.agent.chatStream(question, (event) => {
|
|
55
|
-
// Track events silently
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
messageCount++;
|
|
59
|
-
} finally {
|
|
60
|
-
// Reset state (like the UI does)
|
|
61
|
-
mockUIState.isProcessing = false;
|
|
62
|
-
mockUIState.inputEnabled = true;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Verify state is properly reset
|
|
66
|
-
assert.strictEqual(mockUIState.isProcessing, false, `isProcessing should be reset after question ${i + 1}`);
|
|
67
|
-
assert.strictEqual(mockUIState.inputEnabled, true, `inputEnabled should be reset after question ${i + 1}`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
assert.strictEqual(messageCount, 3, 'Should have processed all 3 messages');
|
|
71
|
-
});
|
|
72
|
-
});
|