paperclip-mcp 1.2.4 → 1.2.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/tools/identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/tools/identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,eAAO,MAAM,aAAa,EAAE,cAAc,EAgDzC,CAAC"}
|
package/dist/tools/identity.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { validate, NoInput, handleApiError } from "./validation.js";
|
|
2
|
-
import { PaperclipApiError } from "../errors.js";
|
|
3
2
|
export const identityTools = [
|
|
4
3
|
{
|
|
5
4
|
name: "paperclip_get_me",
|
|
@@ -13,19 +12,11 @@ export const identityTools = [
|
|
|
13
12
|
async handler(args, client) {
|
|
14
13
|
try {
|
|
15
14
|
validate(NoInput, args);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (primaryErr instanceof PaperclipApiError && primaryErr.status === 401) {
|
|
22
|
-
// /api/agents/me requires a JWT with agent sub claim; fall back to the
|
|
23
|
-
// agent-scoped endpoint which works with any company-level API key.
|
|
24
|
-
const data = await client.get(`/api/agents/${client.agentId}`);
|
|
25
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
26
|
-
}
|
|
27
|
-
throw primaryErr;
|
|
28
|
-
}
|
|
15
|
+
// Use the agent-scoped endpoint directly. /api/agents/me resolves the
|
|
16
|
+
// API key's principal, which is the CEO when a company-level key is used —
|
|
17
|
+
// not the dispatched agent. The ID-scoped path always returns the correct agent.
|
|
18
|
+
const data = await client.get(`/api/agents/${client.agentId}`);
|
|
19
|
+
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
29
20
|
}
|
|
30
21
|
catch (err) {
|
|
31
22
|
return handleApiError(err);
|
|
@@ -44,19 +35,10 @@ export const identityTools = [
|
|
|
44
35
|
async handler(args, client) {
|
|
45
36
|
try {
|
|
46
37
|
validate(NoInput, args);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
catch (primaryErr) {
|
|
52
|
-
if (primaryErr instanceof PaperclipApiError && primaryErr.status === 401) {
|
|
53
|
-
// /api/agents/me/inbox-lite requires a JWT with agent sub claim; fall back
|
|
54
|
-
// to filtering company issues by assignee, which works with any API key.
|
|
55
|
-
const data = await client.get(`/api/companies/${client.companyId}/issues?assigneeAgentId=${client.agentId}`);
|
|
56
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
57
|
-
}
|
|
58
|
-
throw primaryErr;
|
|
59
|
-
}
|
|
38
|
+
// Use the company-issues endpoint filtered by assignee. /api/agents/me/inbox-lite
|
|
39
|
+
// resolves by API key principal (CEO with a company-level key), so skip it entirely.
|
|
40
|
+
const data = await client.get(`/api/companies/${client.companyId}/issues?assigneeAgentId=${client.agentId}`);
|
|
41
|
+
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
60
42
|
}
|
|
61
43
|
catch (err) {
|
|
62
44
|
return handleApiError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/tools/identity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/tools/identity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEpE,MAAM,CAAC,MA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