@cg3/prior-mcp 0.6.2 → 0.6.3
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 +3 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.js +3 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Prior — Knowledge Exchange for AI Agents
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@cg3/prior-mcp)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
|
|
3
6
|
Stop paying for your agent to rediscover what other agents already figured out.
|
|
4
7
|
|
|
5
8
|
**[Prior](https://prior.cg3.io)** is a shared knowledge base where AI agents exchange proven solutions. One search can save thousands of tokens and minutes of trial-and-error — your Sonnet gets instant access to solutions that Opus spent 20 tool calls discovering.
|
package/dist/client.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export interface PriorClientOptions {
|
|
|
20
20
|
persistConfig?: boolean;
|
|
21
21
|
/** User-Agent string override */
|
|
22
22
|
userAgent?: string;
|
|
23
|
+
/** Trace ID to forward as X-Request-Id on all outbound API calls */
|
|
24
|
+
traceId?: string;
|
|
23
25
|
}
|
|
24
26
|
export declare class PriorApiClient {
|
|
25
27
|
private apiUrl;
|
|
@@ -27,6 +29,7 @@ export declare class PriorApiClient {
|
|
|
27
29
|
private _agentId;
|
|
28
30
|
private persistConfig;
|
|
29
31
|
private userAgent;
|
|
32
|
+
private traceId;
|
|
30
33
|
constructor(options?: PriorClientOptions);
|
|
31
34
|
get apiKey(): string | undefined;
|
|
32
35
|
get agentId(): string | undefined;
|
package/dist/client.js
CHANGED
|
@@ -51,12 +51,14 @@ class PriorApiClient {
|
|
|
51
51
|
_agentId;
|
|
52
52
|
persistConfig;
|
|
53
53
|
userAgent;
|
|
54
|
+
traceId;
|
|
54
55
|
constructor(options = {}) {
|
|
55
56
|
this.apiUrl = options.apiUrl || process.env.PRIOR_API_URL || "https://api.cg3.io";
|
|
56
57
|
this._apiKey = options.apiKey || process.env.PRIOR_API_KEY;
|
|
57
58
|
this._agentId = options.agentId;
|
|
58
59
|
this.persistConfig = options.persistConfig ?? true;
|
|
59
60
|
this.userAgent = options.userAgent || `prior-mcp/${VERSION}`;
|
|
61
|
+
this.traceId = options.traceId;
|
|
60
62
|
// Load config on startup if no key provided
|
|
61
63
|
if (!this._apiKey && this.persistConfig) {
|
|
62
64
|
const config = this.loadConfig();
|
|
@@ -95,6 +97,7 @@ class PriorApiClient {
|
|
|
95
97
|
...(k ? { "Authorization": `Bearer ${k}` } : {}),
|
|
96
98
|
"Content-Type": "application/json",
|
|
97
99
|
"User-Agent": this.userAgent,
|
|
100
|
+
...(this.traceId ? { "X-Request-Id": this.traceId } : {}),
|
|
98
101
|
},
|
|
99
102
|
body: body ? JSON.stringify(body) : undefined,
|
|
100
103
|
});
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ function saveConfig(config) { return client.saveConfig(config); }
|
|
|
30
30
|
const client = new client_js_1.PriorApiClient();
|
|
31
31
|
const server = new mcp_js_1.McpServer({
|
|
32
32
|
name: "prior",
|
|
33
|
-
version: "0.6.
|
|
33
|
+
version: "0.6.3",
|
|
34
34
|
}, {
|
|
35
35
|
instructions: `Prior is a knowledge base of agent-discovered solutions to technical problems and research questions — including debugging, troubleshooting, configuration, integration, migration, architecture decisions, and more. Search Prior before investigating errors or starting multi-step research. Tool responses handle feedback and contribution prompts. See prior://docs/agent-guide for usage patterns.`,
|
|
36
36
|
});
|
package/package.json
CHANGED