@probelabs/probe 0.6.0-rc56 → 0.6.0-rc58

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 (83) hide show
  1. package/README.md +55 -0
  2. package/bin/probe +0 -0
  3. package/bin/probe-binary +0 -0
  4. package/build/agent/ProbeAgent.js +722 -0
  5. package/build/agent/acp/README.md +347 -0
  6. package/build/agent/acp/connection.js +237 -0
  7. package/build/agent/acp/connection.test.js +307 -0
  8. package/build/agent/acp/examples/simple-client.js +212 -0
  9. package/build/agent/acp/examples/tool-lifecycle.js +230 -0
  10. package/build/agent/acp/final-test.js +173 -0
  11. package/build/agent/acp/index.js +5 -0
  12. package/build/agent/acp/integration.test.js +386 -0
  13. package/build/agent/acp/manual-test.js +410 -0
  14. package/build/agent/acp/protocol-test.js +190 -0
  15. package/build/agent/acp/server.js +448 -0
  16. package/build/agent/acp/server.test.js +373 -0
  17. package/build/agent/acp/test-runner.js +216 -0
  18. package/build/agent/acp/test-utils/README.md +315 -0
  19. package/build/agent/acp/test-utils/acp-tester.js +484 -0
  20. package/build/agent/acp/test-utils/mock-acp-client.js +434 -0
  21. package/build/agent/acp/tools.js +342 -0
  22. package/build/agent/acp/tools.test.js +305 -0
  23. package/build/agent/acp/types.js +218 -0
  24. package/build/agent/acp/types.test.js +327 -0
  25. package/build/agent/appTracer.js +256 -0
  26. package/build/agent/fileSpanExporter.js +169 -0
  27. package/build/agent/index.js +3881 -0
  28. package/build/agent/probeTool.js +248 -0
  29. package/build/agent/schemaUtils.js +107 -0
  30. package/build/agent/simpleTelemetry.js +231 -0
  31. package/build/agent/telemetry.js +225 -0
  32. package/build/agent/tokenCounter.js +376 -0
  33. package/build/agent/tools.js +146 -0
  34. package/build/cli.js +49 -0
  35. package/build/downloader.js +661 -0
  36. package/build/extract.js +149 -0
  37. package/build/index.js +58 -0
  38. package/build/query.js +116 -0
  39. package/build/search.js +239 -0
  40. package/build/tools/common.js +224 -0
  41. package/build/tools/index.js +36 -0
  42. package/build/tools/langchain.js +88 -0
  43. package/build/tools/system-message.js +69 -0
  44. package/build/tools/vercel.js +215 -0
  45. package/build/utils/file-lister.js +193 -0
  46. package/build/utils.js +120 -0
  47. package/package.json +25 -8
  48. package/scripts/postinstall.js +40 -20
  49. package/src/agent/ProbeAgent.js +722 -0
  50. package/src/agent/acp/README.md +347 -0
  51. package/src/agent/acp/connection.js +237 -0
  52. package/src/agent/acp/connection.test.js +307 -0
  53. package/src/agent/acp/examples/simple-client.js +212 -0
  54. package/src/agent/acp/examples/tool-lifecycle.js +230 -0
  55. package/src/agent/acp/final-test.js +173 -0
  56. package/src/agent/acp/index.js +5 -0
  57. package/src/agent/acp/integration.test.js +386 -0
  58. package/src/agent/acp/manual-test.js +410 -0
  59. package/src/agent/acp/protocol-test.js +190 -0
  60. package/src/agent/acp/server.js +448 -0
  61. package/src/agent/acp/server.test.js +373 -0
  62. package/src/agent/acp/test-runner.js +216 -0
  63. package/src/agent/acp/test-utils/README.md +315 -0
  64. package/src/agent/acp/test-utils/acp-tester.js +484 -0
  65. package/src/agent/acp/test-utils/mock-acp-client.js +434 -0
  66. package/src/agent/acp/tools.js +342 -0
  67. package/src/agent/acp/tools.test.js +305 -0
  68. package/src/agent/acp/types.js +218 -0
  69. package/src/agent/acp/types.test.js +327 -0
  70. package/src/agent/appTracer.js +256 -0
  71. package/src/agent/fileSpanExporter.js +169 -0
  72. package/src/agent/index.js +548 -0
  73. package/src/agent/probeTool.js +248 -0
  74. package/src/agent/schemaUtils.js +107 -0
  75. package/src/agent/simpleTelemetry.js +231 -0
  76. package/src/agent/telemetry.js +225 -0
  77. package/src/agent/tokenCounter.js +376 -0
  78. package/src/agent/tools.js +146 -0
  79. package/src/downloader.js +135 -45
  80. package/src/extract.js +12 -10
  81. package/src/index.js +3 -0
  82. package/src/query.js +12 -8
  83. package/src/search.js +19 -15
package/README.md CHANGED
@@ -77,6 +77,61 @@ probe mcp
77
77
 
78
78
  The package installs the actual probe binary, not a JavaScript wrapper, so you get the full native performance and all features of the original probe CLI.
79
79
 
80
+ ### Using ProbeAgent (AI-Powered Code Assistant)
81
+
82
+ ProbeAgent provides a high-level AI-powered interface for interacting with your codebase:
83
+
84
+ ```javascript
85
+ import { ProbeAgent } from '@buger/probe';
86
+
87
+ // Create an AI agent for your project
88
+ const agent = new ProbeAgent({
89
+ sessionId: 'my-session', // Optional: for conversation continuity
90
+ path: '/path/to/your/project',
91
+ provider: 'anthropic', // or 'openai', 'google'
92
+ model: 'claude-3-5-sonnet-20241022', // Optional: override model
93
+ allowEdit: false, // Optional: enable code modification
94
+ debug: true // Optional: enable debug logging
95
+ });
96
+
97
+ // Ask questions about your codebase
98
+ const answer = await agent.answer("How does authentication work in this codebase?");
99
+ console.log(answer);
100
+
101
+ // The agent maintains conversation history automatically
102
+ const followUp = await agent.answer("Can you show me the login implementation?");
103
+ console.log(followUp);
104
+
105
+ // Get token usage statistics
106
+ const usage = agent.getTokenUsage();
107
+ console.log(`Used ${usage.total} tokens total`);
108
+
109
+ // Clear conversation history if needed
110
+ agent.history = [];
111
+ ```
112
+
113
+ **Environment Variables:**
114
+ ```bash
115
+ # Set your API key for the chosen provider
116
+ export ANTHROPIC_API_KEY=your_anthropic_key
117
+ export OPENAI_API_KEY=your_openai_key
118
+ export GOOGLE_API_KEY=your_google_key
119
+
120
+ # Optional: Force a specific provider
121
+ export FORCE_PROVIDER=anthropic
122
+
123
+ # Optional: Override model name
124
+ export MODEL_NAME=claude-3-5-sonnet-20241022
125
+ ```
126
+
127
+ **ProbeAgent Features:**
128
+ - **Multi-turn conversations** with automatic history management
129
+ - **Code search integration** - Uses probe's search capabilities transparently
130
+ - **Multiple AI providers** - Supports Anthropic Claude, OpenAI GPT, Google Gemini
131
+ - **Session management** - Maintain conversation context across calls
132
+ - **Token tracking** - Monitor usage and costs
133
+ - **Configurable personas** - Engineer, architect, code-review, and more
134
+
80
135
  ### Using as an MCP Server
81
136
 
82
137
  Probe includes a built-in MCP (Model Context Protocol) server for integration with AI assistants:
package/bin/probe CHANGED
Binary file
Binary file