@withpica/mcp-server 2.50.0 → 2.52.0
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/.claude/settings.local.json +5 -0
- package/CHANGELOG.md +0 -25
- package/dist/prompts/index.d.ts +0 -32
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +0 -235
- package/dist/prompts/index.js.map +1 -1
- package/dist/server.d.ts +0 -26
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -108
- package/dist/server.js.map +1 -1
- package/dist/tools/agent-identity.d.ts.map +1 -1
- package/dist/tools/agent-identity.js +0 -15
- package/dist/tools/agent-identity.js.map +1 -1
- package/dist/tools/agreement-types.d.ts.map +1 -1
- package/dist/tools/agreement-types.js +0 -24
- package/dist/tools/agreement-types.js.map +1 -1
- package/dist/tools/agreements.d.ts.map +1 -1
- package/dist/tools/agreements.js +3 -21
- package/dist/tools/agreements.js.map +1 -1
- package/dist/tools/analytics.d.ts.map +1 -1
- package/dist/tools/analytics.js +1 -19
- package/dist/tools/analytics.js.map +1 -1
- package/dist/tools/app-tools.d.ts.map +1 -1
- package/dist/tools/app-tools.js +2 -11
- package/dist/tools/app-tools.js.map +1 -1
- package/dist/tools/assets.d.ts.map +1 -1
- package/dist/tools/assets.js +0 -33
- package/dist/tools/assets.js.map +1 -1
- package/dist/tools/audio-files.d.ts +0 -5
- package/dist/tools/audio-files.d.ts.map +1 -1
- package/dist/tools/audio-files.js +0 -91
- package/dist/tools/audio-files.js.map +1 -1
- package/dist/tools/audit.d.ts.map +1 -1
- package/dist/tools/audit.js +2 -11
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +0 -6
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/bulk.d.ts.map +1 -1
- package/dist/tools/bulk.js +0 -6
- package/dist/tools/bulk.js.map +1 -1
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/calendar.js +0 -3
- package/dist/tools/calendar.js.map +1 -1
- package/dist/tools/collaborators.d.ts.map +1 -1
- package/dist/tools/collaborators.js +3 -24
- package/dist/tools/collaborators.js.map +1 -1
- package/dist/tools/comparisons.d.ts.map +1 -1
- package/dist/tools/comparisons.js +0 -6
- package/dist/tools/comparisons.js.map +1 -1
- package/dist/tools/credits.d.ts +0 -18
- package/dist/tools/credits.d.ts.map +1 -1
- package/dist/tools/credits.js +4 -344
- package/dist/tools/credits.js.map +1 -1
- package/dist/tools/custody.d.ts.map +1 -1
- package/dist/tools/custody.js +2 -23
- package/dist/tools/custody.js.map +1 -1
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +7 -43
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/directory.d.ts.map +1 -1
- package/dist/tools/directory.js +0 -3
- package/dist/tools/directory.js.map +1 -1
- package/dist/tools/discovery.d.ts.map +1 -1
- package/dist/tools/discovery.js +7 -86
- package/dist/tools/discovery.js.map +1 -1
- package/dist/tools/disputes.d.ts.map +1 -1
- package/dist/tools/disputes.js +1 -4
- package/dist/tools/disputes.js.map +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +0 -3
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/duplicates.d.ts.map +1 -1
- package/dist/tools/duplicates.js +0 -6
- package/dist/tools/duplicates.js.map +1 -1
- package/dist/tools/enrichment.d.ts.map +1 -1
- package/dist/tools/enrichment.js +0 -33
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/exports.d.ts.map +1 -1
- package/dist/tools/exports.js +3 -18
- package/dist/tools/exports.js.map +1 -1
- package/dist/tools/feedback.d.ts.map +1 -1
- package/dist/tools/feedback.js +0 -3
- package/dist/tools/feedback.js.map +1 -1
- package/dist/tools/files.d.ts +30 -0
- package/dist/tools/files.d.ts.map +1 -0
- package/dist/tools/files.js +98 -0
- package/dist/tools/files.js.map +1 -0
- package/dist/tools/groups.d.ts.map +1 -1
- package/dist/tools/groups.js +0 -12
- package/dist/tools/groups.js.map +1 -1
- package/dist/tools/import-documents.d.ts.map +1 -1
- package/dist/tools/import-documents.js +1 -10
- package/dist/tools/import-documents.js.map +1 -1
- package/dist/tools/import.d.ts.map +1 -1
- package/dist/tools/import.js +3 -36
- package/dist/tools/import.js.map +1 -1
- package/dist/tools/index.d.ts +4 -99
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +105 -182
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +8 -28
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/labels.d.ts.map +1 -1
- package/dist/tools/labels.js +0 -3
- package/dist/tools/labels.js.map +1 -1
- package/dist/tools/licensing.d.ts.map +1 -1
- package/dist/tools/licensing.js +0 -15
- package/dist/tools/licensing.js.map +1 -1
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/memory.js +3 -15
- package/dist/tools/memory.js.map +1 -1
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +15 -64
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/multimedia.d.ts.map +1 -1
- package/dist/tools/multimedia.js +0 -15
- package/dist/tools/multimedia.js.map +1 -1
- package/dist/tools/my-reported-issues.d.ts.map +1 -1
- package/dist/tools/my-reported-issues.js +0 -3
- package/dist/tools/my-reported-issues.js.map +1 -1
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +0 -12
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/notifications.d.ts.map +1 -1
- package/dist/tools/notifications.js +1 -25
- package/dist/tools/notifications.js.map +1 -1
- package/dist/tools/onboarding.d.ts.map +1 -1
- package/dist/tools/onboarding.js +0 -3
- package/dist/tools/onboarding.js.map +1 -1
- package/dist/tools/people.d.ts.map +1 -1
- package/dist/tools/people.js +1 -16
- package/dist/tools/people.js.map +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +0 -18
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/publishers.d.ts.map +1 -1
- package/dist/tools/publishers.js +0 -6
- package/dist/tools/publishers.js.map +1 -1
- package/dist/tools/recordings.d.ts.map +1 -1
- package/dist/tools/recordings.js +0 -15
- package/dist/tools/recordings.js.map +1 -1
- package/dist/tools/recovery-hints.d.ts.map +1 -1
- package/dist/tools/recovery-hints.js +2 -28
- package/dist/tools/recovery-hints.js.map +1 -1
- package/dist/tools/release-rich.d.ts.map +1 -1
- package/dist/tools/release-rich.js +2 -4
- package/dist/tools/release-rich.js.map +1 -1
- package/dist/tools/releases.d.ts.map +1 -1
- package/dist/tools/releases.js +0 -55
- package/dist/tools/releases.js.map +1 -1
- package/dist/tools/report-issue.d.ts.map +1 -1
- package/dist/tools/report-issue.js +0 -3
- package/dist/tools/report-issue.js.map +1 -1
- package/dist/tools/royalties.d.ts.map +1 -1
- package/dist/tools/royalties.js +3 -18
- package/dist/tools/royalties.js.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +1 -10
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/send.d.ts.map +1 -1
- package/dist/tools/send.js +0 -9
- package/dist/tools/send.js.map +1 -1
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +0 -12
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +3 -30
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/share-links.d.ts.map +1 -1
- package/dist/tools/share-links.js +0 -15
- package/dist/tools/share-links.js.map +1 -1
- package/dist/tools/signup.d.ts.map +1 -1
- package/dist/tools/signup.js +0 -3
- package/dist/tools/signup.js.map +1 -1
- package/dist/tools/split-sheets.d.ts.map +1 -1
- package/dist/tools/split-sheets.js +1 -22
- package/dist/tools/split-sheets.js.map +1 -1
- package/dist/tools/storage-config.d.ts.map +1 -1
- package/dist/tools/storage-config.js +0 -6
- package/dist/tools/storage-config.js.map +1 -1
- package/dist/tools/subscription.d.ts.map +1 -1
- package/dist/tools/subscription.js +10 -9
- package/dist/tools/subscription.js.map +1 -1
- package/dist/tools/sync-placements.d.ts.map +1 -1
- package/dist/tools/sync-placements.js +2 -20
- package/dist/tools/sync-placements.js.map +1 -1
- package/dist/tools/team.d.ts.map +1 -1
- package/dist/tools/team.js +0 -15
- package/dist/tools/team.js.map +1 -1
- package/dist/tools/telegram.d.ts.map +1 -1
- package/dist/tools/telegram.js +0 -9
- package/dist/tools/telegram.js.map +1 -1
- package/dist/tools/uploads.d.ts.map +1 -1
- package/dist/tools/uploads.js +0 -6
- package/dist/tools/uploads.js.map +1 -1
- package/dist/tools/works.d.ts.map +1 -1
- package/dist/tools/works.js +3 -37
- package/dist/tools/works.js.map +1 -1
- package/package.json +4 -4
- package/server.json +2 -2
- package/dist/prompts/creator-question-atlas.d.ts +0 -48
- package/dist/prompts/creator-question-atlas.d.ts.map +0 -1
- package/dist/prompts/creator-question-atlas.js +0 -601
- package/dist/prompts/creator-question-atlas.js.map +0 -1
- package/dist/tools/access-simulate.d.ts +0 -23
- package/dist/tools/access-simulate.d.ts.map +0 -1
- package/dist/tools/access-simulate.js +0 -165
- package/dist/tools/access-simulate.js.map +0 -1
- package/dist/tools/explainability.d.ts +0 -24
- package/dist/tools/explainability.d.ts.map +0 -1
- package/dist/tools/explainability.js +0 -137
- package/dist/tools/explainability.js.map +0 -1
- package/dist/tools/my-recent-questions.d.ts +0 -25
- package/dist/tools/my-recent-questions.d.ts.map +0 -1
- package/dist/tools/my-recent-questions.js +0 -186
- package/dist/tools/my-recent-questions.js.map +0 -1
- package/dist/tools/share-send.d.ts +0 -28
- package/dist/tools/share-send.d.ts.map +0 -1
- package/dist/tools/share-send.js +0 -131
- package/dist/tools/share-send.js.map +0 -1
- package/dist/tools/sharing.d.ts +0 -29
- package/dist/tools/sharing.d.ts.map +0 -1
- package/dist/tools/sharing.js +0 -131
- package/dist/tools/sharing.js.map +0 -1
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
import { formatSuccess, formatValidationError } from "@withpica/mcp-utils";
|
|
3
|
-
const ENTITY_TYPES = ["work", "recording", "person", "release"];
|
|
4
|
-
const ACTIONS = ["view", "share_link_preview", "claim", "grant"];
|
|
5
|
-
const RECIPIENT_TYPES = ["user", "anonymous", "share_link"];
|
|
6
|
-
export class AccessSimulateTools {
|
|
7
|
-
pica;
|
|
8
|
-
constructor(pica) {
|
|
9
|
-
this.pica = pica;
|
|
10
|
-
}
|
|
11
|
-
getTools() {
|
|
12
|
-
return [
|
|
13
|
-
{
|
|
14
|
-
definition: {
|
|
15
|
-
name: "pica_access_simulate",
|
|
16
|
-
tier: "read",
|
|
17
|
-
description: "Simulate who would see what — for any work, recording, person, or " +
|
|
18
|
-
"release, given a hypothetical action (view, share-link preview, " +
|
|
19
|
-
"claim, grant) and a recipient configuration, returns the visible " +
|
|
20
|
-
"and hidden fields plus the chain of rules that produced the answer. " +
|
|
21
|
-
"Read-only — never mutates state. Use BEFORE creating a share link " +
|
|
22
|
-
"to verify the recipient sees what you intend, or BEFORE claiming " +
|
|
23
|
-
"custody to see what changes. v1 ships real share_link_preview " +
|
|
24
|
-
"logic for works; other paths return a stable scaffolded shape.",
|
|
25
|
-
workflows: "infrastructure",
|
|
26
|
-
vernacular_kind: "specialist",
|
|
27
|
-
vernacular_reason: "Specialist read-only simulator — agents invoke this BEFORE a share link / claim / grant action to preview what the recipient would see. Not a natural-language entry surface; invoked operationally as a safety check, not from a 'Use when the user asks' question.",
|
|
28
|
-
inputSchema: {
|
|
29
|
-
type: "object",
|
|
30
|
-
properties: {
|
|
31
|
-
entity_type: {
|
|
32
|
-
type: "string",
|
|
33
|
-
enum: [...ENTITY_TYPES],
|
|
34
|
-
description: "Entity to simulate access for. v1 implements 'work' fully; the others return a not_yet_supported scaffold with the same shape so agents can iterate against the API.",
|
|
35
|
-
},
|
|
36
|
-
entity_id: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "UUID of the entity. Must belong to the caller's organisation — cross-org IDs return entity_not_found rather than leaking existence.",
|
|
39
|
-
},
|
|
40
|
-
action: {
|
|
41
|
-
type: "string",
|
|
42
|
-
enum: [...ACTIONS],
|
|
43
|
-
description: "Access action to simulate. 'share_link_preview' is the v1 real path: pass recipient.share_config and get back the field-level visibility matrix the share link would expose. The other actions return scaffolded responses.",
|
|
44
|
-
},
|
|
45
|
-
recipient: {
|
|
46
|
-
type: "object",
|
|
47
|
-
description: "Hypothetical recipient. For share_link_preview pass type='share_link' and a share_config; for view/claim/grant pass type='user'/'org' as appropriate.",
|
|
48
|
-
properties: {
|
|
49
|
-
type: {
|
|
50
|
-
type: "string",
|
|
51
|
-
enum: [...RECIPIENT_TYPES],
|
|
52
|
-
description: "Recipient type — 'user' (authenticated user_id), 'anonymous' (no auth), 'share_link' (hypothetical share-link config).",
|
|
53
|
-
},
|
|
54
|
-
user_id: {
|
|
55
|
-
type: "string",
|
|
56
|
-
description: "Recipient user UUID, when type='user'. Optional otherwise.",
|
|
57
|
-
},
|
|
58
|
-
org_id: {
|
|
59
|
-
type: "string",
|
|
60
|
-
description: "Recipient organisation UUID, when simulating an action that targets an org (e.g. 'grant'). Optional otherwise.",
|
|
61
|
-
},
|
|
62
|
-
share_config: {
|
|
63
|
-
type: "object",
|
|
64
|
-
description: "Hypothetical share-link configuration to simulate. Fields mirror the share-links write surface — access_type, allow_*, allowed_person_ids, sent_to_emails, watermark_audio, expires_at, max_views.",
|
|
65
|
-
properties: {
|
|
66
|
-
access_type: {
|
|
67
|
-
type: "string",
|
|
68
|
-
enum: ["private", "limited", "public"],
|
|
69
|
-
description: "Recipient scope — 'private' (allowed_person_ids only), 'limited' (sent_to_emails only), 'public' (anyone with link).",
|
|
70
|
-
},
|
|
71
|
-
allow_download: {
|
|
72
|
-
type: "boolean",
|
|
73
|
-
description: "When true, the recipient can download original audio files. Pair with watermark_audio=true for pre-release pitches.",
|
|
74
|
-
},
|
|
75
|
-
allow_streaming: {
|
|
76
|
-
type: "boolean",
|
|
77
|
-
description: "When true, the recipient can stream audio inline.",
|
|
78
|
-
},
|
|
79
|
-
allow_comments: {
|
|
80
|
-
type: "boolean",
|
|
81
|
-
description: "When true, the recipient sees the discussion thread and can post comments.",
|
|
82
|
-
},
|
|
83
|
-
allow_view_collaborators: {
|
|
84
|
-
type: "boolean",
|
|
85
|
-
description: "When true, the recipient sees the credit lines, splits, and attestation status.",
|
|
86
|
-
},
|
|
87
|
-
allow_view_financials: {
|
|
88
|
-
type: "boolean",
|
|
89
|
-
description: "When true, the recipient sees earnings, advances, and royalty statements. The most common reason a recipient sees less than expected.",
|
|
90
|
-
},
|
|
91
|
-
watermark_audio: {
|
|
92
|
-
type: "boolean",
|
|
93
|
-
description: "When true, audio surfaces are mixed with an inaudible watermark identifier.",
|
|
94
|
-
},
|
|
95
|
-
notify_on_access: {
|
|
96
|
-
type: "boolean",
|
|
97
|
-
description: "When true, the link's creator gets notified each time the recipient accesses it.",
|
|
98
|
-
},
|
|
99
|
-
allowed_person_ids: {
|
|
100
|
-
type: "array",
|
|
101
|
-
items: { type: "string" },
|
|
102
|
-
description: "Person UUIDs allowed to access when access_type='private'.",
|
|
103
|
-
},
|
|
104
|
-
sent_to_emails: {
|
|
105
|
-
type: "array",
|
|
106
|
-
items: { type: "string" },
|
|
107
|
-
description: "Email addresses the link was sent to when access_type='limited'.",
|
|
108
|
-
},
|
|
109
|
-
max_views: {
|
|
110
|
-
type: "number",
|
|
111
|
-
description: "Cap on total views; null/omitted for unlimited. <=0 makes the link unusable.",
|
|
112
|
-
},
|
|
113
|
-
expires_at: {
|
|
114
|
-
type: "string",
|
|
115
|
-
description: "ISO timestamp; recipients see an expired page after this time.",
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
required: ["access_type"],
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
required: ["type"],
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
required: ["entity_type", "entity_id", "action", "recipient"],
|
|
125
|
-
},
|
|
126
|
-
annotations: {
|
|
127
|
-
readOnlyHint: true,
|
|
128
|
-
idempotentHint: true,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
executor: this.simulate.bind(this),
|
|
132
|
-
},
|
|
133
|
-
];
|
|
134
|
-
}
|
|
135
|
-
async simulate(args) {
|
|
136
|
-
if (!args.entity_type || !ENTITY_TYPES.includes(args.entity_type)) {
|
|
137
|
-
return formatValidationError({
|
|
138
|
-
entity_type: `must be one of: ${ENTITY_TYPES.join(", ")}`,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
if (!args.entity_id || typeof args.entity_id !== "string") {
|
|
142
|
-
return formatValidationError({ entity_id: "is required" });
|
|
143
|
-
}
|
|
144
|
-
if (!args.action || !ACTIONS.includes(args.action)) {
|
|
145
|
-
return formatValidationError({
|
|
146
|
-
action: `must be one of: ${ACTIONS.join(", ")}`,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
if (!args.recipient ||
|
|
150
|
-
typeof args.recipient !== "object" ||
|
|
151
|
-
!RECIPIENT_TYPES.includes(args.recipient.type)) {
|
|
152
|
-
return formatValidationError({
|
|
153
|
-
recipient: `recipient.type must be one of: ${RECIPIENT_TYPES.join(", ")}`,
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
const result = await this.pica.accessSimulate.simulate(args);
|
|
157
|
-
const summary = result.not_yet_supported
|
|
158
|
-
? `Access simulation scaffolded (v1 stub) — ${result.reasons[0]?.detail ?? "see reasons"}`
|
|
159
|
-
: result.visible
|
|
160
|
-
? `Access simulated — ${result.visible_fields.length} field(s) visible, ${result.hidden_fields.length} hidden, ${result.warnings.length} warning(s)`
|
|
161
|
-
: `Access denied — ${result.reasons[0]?.detail ?? "see reasons"}`;
|
|
162
|
-
return formatSuccess(summary, result);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
//# sourceMappingURL=access-simulate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"access-simulate.js","sourceRoot":"","sources":["../../src/tools/access-simulate.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAiB7D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE3E,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AACzE,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAC1E,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAU,CAAC;AAErE,MAAM,OAAO,mBAAmB;IACtB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,sBAAsB;oBAC5B,IAAI,EAAE,MAAM;oBACZ,WAAW,EACT,oEAAoE;wBACpE,kEAAkE;wBAClE,mEAAmE;wBACnE,sEAAsE;wBACtE,oEAAoE;wBACpE,mEAAmE;wBACnE,gEAAgE;wBAChE,gEAAgE;oBAClE,SAAS,EAAE,gBAAgB;oBAC3B,eAAe,EAAE,YAAY;oBAC7B,iBAAiB,EACf,sQAAsQ;oBACxQ,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,WAAW,EAAE;gCACX,IAAI,EAAE,QAAQ;gCACd,IAAI,EAAE,CAAC,GAAG,YAAY,CAAC;gCACvB,WAAW,EACT,sKAAsK;6BACzK;4BACD,SAAS,EAAE;gCACT,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,qIAAqI;6BACxI;4BACD,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,IAAI,EAAE,CAAC,GA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AAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACnD,OAAO,qBAAqB,CAAC;gBAC3B,MAAM,EAAE,mBAAmB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aAChD,CAAC,CAAC;QACL,CAAC;QACD,IACE,CAAC,IAAI,CAAC,SAAS;YACf,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ;YAClC,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAC9C,CAAC;YACD,OAAO,qBAAqB,CAAC;gBAC3B,SAAS,EAAE,kCAAkC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aAC1E,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CACpD,IAA2B,CAC5B,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,CAAC,iBAAiB;YACtC,CAAC,CAAC,4CAA4C,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,aAAa,EAAE;YAC1F,CAAC,CAAC,MAAM,CAAC,OAAO;gBACd,CAAC,CAAC,sBAAsB,MAAM,CAAC,cAAc,CAAC,MAAM,sBAAsB,MAAM,CAAC,aAAa,CAAC,MAAM,YAAY,MAAM,CAAC,QAAQ,CAAC,MAAM,aAAa;gBACpJ,CAAC,CAAC,mBAAmB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,aAAa,EAAE,CAAC;QAEtE,OAAO,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Explainability MCP Tools — ADR-232 § Decision 3
|
|
3
|
-
*
|
|
4
|
-
* pica_count_explain — generic explainer for dashboard / briefing
|
|
5
|
-
* count discrepancies. Closed-enum count_source (additive). When the
|
|
6
|
-
* agent sees "the dashboard says 80 but pica_works_query counts 78",
|
|
7
|
-
* this tool returns the canonical query + delta_breakdown rather than
|
|
8
|
-
* forcing a guess-and-recount loop.
|
|
9
|
-
*
|
|
10
|
-
* AC-5: unknown count_source → INVALID_INPUT (structured error, not 500).
|
|
11
|
-
* AC-6: delta_breakdown[].count sums to absolute delta (no off-by-one).
|
|
12
|
-
*/
|
|
13
|
-
import { PicaClient } from "@withpica/mcp-sdk";
|
|
14
|
-
import type { ToolDefinition, ToolExecutor } from "./index.js";
|
|
15
|
-
export declare class ExplainabilityTools {
|
|
16
|
-
private pica;
|
|
17
|
-
constructor(pica: PicaClient);
|
|
18
|
-
getTools(): Array<{
|
|
19
|
-
definition: ToolDefinition;
|
|
20
|
-
executor: ToolExecutor;
|
|
21
|
-
}>;
|
|
22
|
-
private countExplain;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=explainability.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"explainability.d.ts","sourceRoot":"","sources":["../../src/tools/explainability.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAgB3E,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAkD3D,YAAY;CA6E3B"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
import { formatSuccess } from "@withpica/mcp-utils";
|
|
3
|
-
// Mirror of COUNT_SOURCES in lib/services/count-explain.ts. The lint
|
|
4
|
-
// check at scripts/lint-mcp-tools.ts asserts this stays in sync with
|
|
5
|
-
// the service-layer registry. Adding a value here without a registry
|
|
6
|
-
// entry trips the lint at build time.
|
|
7
|
-
const COUNT_SOURCES = [
|
|
8
|
-
"dashboard.registered_pro",
|
|
9
|
-
"dashboard.registered_nro",
|
|
10
|
-
"briefing.audio_pending",
|
|
11
|
-
"briefing.unconnected_collaborators",
|
|
12
|
-
"briefing.unverified_writers",
|
|
13
|
-
"briefing.works_without_credits",
|
|
14
|
-
];
|
|
15
|
-
export class ExplainabilityTools {
|
|
16
|
-
pica;
|
|
17
|
-
constructor(pica) {
|
|
18
|
-
this.pica = pica;
|
|
19
|
-
}
|
|
20
|
-
getTools() {
|
|
21
|
-
return [
|
|
22
|
-
{
|
|
23
|
-
definition: {
|
|
24
|
-
name: "pica_count_explain",
|
|
25
|
-
tier: "read",
|
|
26
|
-
description: "Use when the user asks: 'why does the dashboard say 80 but I counted 78?', 'where are the missing works?', 'explain this number'. " +
|
|
27
|
-
"Generic explainer for dashboard / briefing count discrepancies. " +
|
|
28
|
-
"Closed enum of 6 count sources (additive). Returns the canonical query, the computed value, and (when observed_value supplied) a delta_breakdown that sums to the absolute delta. " +
|
|
29
|
-
"→ then: pica_works_query (drill into the specific rows), pica_dashboard_briefing (re-read the briefing now that you understand the count)",
|
|
30
|
-
workflows: "infrastructure",
|
|
31
|
-
vernacular_kind: "creator-entry",
|
|
32
|
-
inputSchema: {
|
|
33
|
-
type: "object",
|
|
34
|
-
properties: {
|
|
35
|
-
count_source: {
|
|
36
|
-
type: "string",
|
|
37
|
-
enum: [...COUNT_SOURCES],
|
|
38
|
-
description: "Which count to explain. dashboard.registered_pro: works registered with any PRO (PRS, ASCAP, BMI, SACEM, GEMA, JASRAC, etc.). dashboard.registered_nro: works registered with any NRO (PPL, SoundExchange, GVL, etc.). briefing.audio_pending: audio_files where analysis_status='pending'. briefing.unconnected_collaborators: distinct credited people without a linked PICA user. briefing.unverified_writers: writer credits where attestation_status != 'attested'. briefing.works_without_credits: works with zero work_credits rows.",
|
|
39
|
-
},
|
|
40
|
-
observed_value: {
|
|
41
|
-
type: "number",
|
|
42
|
-
description: "Optional. The number the user is seeing somewhere else. When supplied, the response includes delta + delta_breakdown.",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
required: ["count_source"],
|
|
46
|
-
},
|
|
47
|
-
nextSteps: [
|
|
48
|
-
{
|
|
49
|
-
tool: "pica_works_query",
|
|
50
|
-
reason: "Drill into the specific works the count covers when investigating a discrepancy.",
|
|
51
|
-
when: "on_success",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
tool: "pica_dashboard_briefing",
|
|
55
|
-
reason: "Re-read the briefing now that the count is explained.",
|
|
56
|
-
when: "on_success",
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
executor: this.countExplain.bind(this),
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
async countExplain(args) {
|
|
65
|
-
const countSource = args.count_source;
|
|
66
|
-
const observedValueRaw = args.observed_value;
|
|
67
|
-
if (!countSource) {
|
|
68
|
-
return {
|
|
69
|
-
content: [{ type: "text", text: "count_source is required." }],
|
|
70
|
-
isError: true,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
if (!COUNT_SOURCES.includes(countSource)) {
|
|
74
|
-
return {
|
|
75
|
-
content: [
|
|
76
|
-
{
|
|
77
|
-
type: "text",
|
|
78
|
-
text: `Invalid count_source '${countSource}'. Must be one of: ${COUNT_SOURCES.join(", ")}.`,
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
isError: true,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
let observedValue;
|
|
85
|
-
if (observedValueRaw !== undefined && observedValueRaw !== null) {
|
|
86
|
-
const parsed = Number(observedValueRaw);
|
|
87
|
-
if (!Number.isFinite(parsed) ||
|
|
88
|
-
!Number.isInteger(parsed) ||
|
|
89
|
-
parsed < 0) {
|
|
90
|
-
return {
|
|
91
|
-
content: [
|
|
92
|
-
{
|
|
93
|
-
type: "text",
|
|
94
|
-
text: "observed_value must be a non-negative integer.",
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
isError: true,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
observedValue = parsed;
|
|
101
|
-
}
|
|
102
|
-
try {
|
|
103
|
-
const result = await this.pica.countExplain.explain({
|
|
104
|
-
count_source: countSource,
|
|
105
|
-
observed_value: observedValue,
|
|
106
|
-
});
|
|
107
|
-
const verdict = result.delta == null
|
|
108
|
-
? `${result.source.name} = ${result.computed_value}`
|
|
109
|
-
: result.delta === 0
|
|
110
|
-
? `${result.source.name} = ${result.computed_value} (matches your observed value)`
|
|
111
|
-
: `${result.source.name} = ${result.computed_value} (differs from observed by ${result.delta})`;
|
|
112
|
-
return formatSuccess(verdict, result);
|
|
113
|
-
}
|
|
114
|
-
catch (err) {
|
|
115
|
-
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
116
|
-
// INVALID_INPUT bubbles up from the API — surface message as-is.
|
|
117
|
-
if (/INVALID_INPUT|invalid_input|400/i.test(errorMessage)) {
|
|
118
|
-
return {
|
|
119
|
-
content: [
|
|
120
|
-
{
|
|
121
|
-
type: "text",
|
|
122
|
-
text: `count_source not recognised. Allowed values: ${COUNT_SOURCES.join(", ")}.`,
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
isError: true,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
content: [
|
|
130
|
-
{ type: "text", text: `Failed to explain count: ${errorMessage}` },
|
|
131
|
-
],
|
|
132
|
-
isError: true,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=explainability.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"explainability.js","sourceRoot":"","sources":["../../src/tools/explainability.ts"],"names":[],"mappings":"AAAA,6DA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,MAAM,OAAO,GACX,MAAM,CAAC,KAAK,IAAI,IAAI;gBAClB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,cAAc,EAAE;gBACpD,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC;oBAClB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,cAAc,gCAAgC;oBAClF,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,cAAc,8BAA8B,MAAM,CAAC,KAAK,GAAG,CAAC;YACtG,OAAO,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,YAAY,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACtE,iEAAiE;YACjE,IAAI,kCAAkC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC1D,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,gDAAgD,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;yBAClF;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,YAAY,EAAE,EAAE;iBACnE;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* My-Recent-Questions Tool — ADR-226 Phase 5.
|
|
3
|
-
*
|
|
4
|
-
* The user-facing auditability surface over the Phase 4 substrate. Lets the
|
|
5
|
-
* caller see what they have been asking the AI to do, what tools ran, and
|
|
6
|
-
* which client the request came from ("Claude Desktop did X / ChatGPT did
|
|
7
|
-
* Y"). User-scoped via the `(user_id = auth.uid())` RLS policy added in
|
|
8
|
-
* PR #255 + service-role + explicit user_id filter in the API route.
|
|
9
|
-
*
|
|
10
|
-
* Filters mirror the Atlas's "what did I ask the AI?" question shape — see
|
|
11
|
-
* `creator-question-atlas.ts` entry resolving to this tool.
|
|
12
|
-
*/
|
|
13
|
-
import { PicaClient } from "@withpica/mcp-sdk";
|
|
14
|
-
import { Tier, ToolDefinition, ToolExecutor } from "./index.js";
|
|
15
|
-
export declare class MyRecentQuestionsTools {
|
|
16
|
-
private pica;
|
|
17
|
-
private getTier;
|
|
18
|
-
constructor(pica: PicaClient, getTier: (name: string) => Tier | undefined);
|
|
19
|
-
getTools(): Array<{
|
|
20
|
-
definition: ToolDefinition;
|
|
21
|
-
executor: ToolExecutor;
|
|
22
|
-
}>;
|
|
23
|
-
private listMine;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=my-recent-questions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"my-recent-questions.d.ts","sourceRoot":"","sources":["../../src/tools/my-recent-questions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AA0C5E,qBAAa,sBAAsB;IACjC,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,OAAO,CAAqC;gBAGlD,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS;IAM7C,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAyD3D,QAAQ;CAqFvB"}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
/**
|
|
3
|
-
* ADR-230 — derive the dominant tier for a row in
|
|
4
|
-
* `assistant_interactions`. The substrate stores `tools_used: text[]`
|
|
5
|
-
* but no `tier` column of its own (Stage 1 decision: Option A — JOIN
|
|
6
|
-
* at read time rather than denormalize).
|
|
7
|
-
*
|
|
8
|
-
* If a row's tools_used spans multiple tiers (e.g. a workflow that
|
|
9
|
-
* runs `pica_works_query` then `pica_works_create` then
|
|
10
|
-
* `pica_works_delete`), surface the most-impactful tier — agents
|
|
11
|
-
* inspecting their own activity want to see the highest-stakes call,
|
|
12
|
-
* not the first one. Order: destructive > write > draft > read.
|
|
13
|
-
*
|
|
14
|
-
* The tier resolver is injected so this module stays decoupled from
|
|
15
|
-
* the registry it reads. ToolRegistry passes
|
|
16
|
-
* `(name) => this.tools.get(name)?.definition.tier` — the declared
|
|
17
|
-
* `tier` on each tool definition is the source of truth (lint Rule 13
|
|
18
|
-
* makes it required for every customer MCP tool).
|
|
19
|
-
*/
|
|
20
|
-
const TIER_RANK = {
|
|
21
|
-
read: 0,
|
|
22
|
-
draft: 1,
|
|
23
|
-
write: 2,
|
|
24
|
-
destructive: 3,
|
|
25
|
-
};
|
|
26
|
-
function dominantTier(tools, getTier) {
|
|
27
|
-
if (!Array.isArray(tools) || tools.length === 0)
|
|
28
|
-
return "read";
|
|
29
|
-
let highest = "read";
|
|
30
|
-
for (const t of tools) {
|
|
31
|
-
const tier = getTier(t) ?? "read";
|
|
32
|
-
if (TIER_RANK[tier] > TIER_RANK[highest]) {
|
|
33
|
-
highest = tier;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return highest;
|
|
37
|
-
}
|
|
38
|
-
export class MyRecentQuestionsTools {
|
|
39
|
-
pica;
|
|
40
|
-
getTier;
|
|
41
|
-
constructor(pica, getTier) {
|
|
42
|
-
this.pica = pica;
|
|
43
|
-
this.getTier = getTier;
|
|
44
|
-
}
|
|
45
|
-
getTools() {
|
|
46
|
-
return [
|
|
47
|
-
{
|
|
48
|
-
definition: {
|
|
49
|
-
name: "pica_my_recent_questions",
|
|
50
|
-
tier: "read",
|
|
51
|
-
description: "Use when the user asks: 'what did I ask the AI?', 'what have I been doing?', 'show me my recent activity', 'what AI tasks did I confirm?'. " +
|
|
52
|
-
"Returns the user's recent questions, what tools the AI ran, and whether each succeeded. " +
|
|
53
|
-
"Renders the originating client per row by joining mcp_sessions, so 'Claude Desktop did X / ChatGPT did Y' is visible at a glance. " +
|
|
54
|
-
"Each row carries `tier` (read | draft | write | destructive — the most-impactful tier across the row's tools_used) so agents can scan stakes at a glance. " +
|
|
55
|
-
"→ then: pica_continue (pick up where you left off)",
|
|
56
|
-
workflows: "infrastructure",
|
|
57
|
-
vernacular_kind: "creator-entry",
|
|
58
|
-
inputSchema: {
|
|
59
|
-
type: "object",
|
|
60
|
-
properties: {
|
|
61
|
-
session_id: {
|
|
62
|
-
type: "string",
|
|
63
|
-
description: "Optional. Filter to a single MCP session — useful for replaying one conversation.",
|
|
64
|
-
},
|
|
65
|
-
since: {
|
|
66
|
-
type: "string",
|
|
67
|
-
description: "Optional. ISO 8601 timestamp lower bound (e.g. '2026-05-01T00:00:00Z').",
|
|
68
|
-
},
|
|
69
|
-
success: {
|
|
70
|
-
type: "boolean",
|
|
71
|
-
description: "Optional. Pass `true` to see only successful interactions, `false` to see only failures.",
|
|
72
|
-
},
|
|
73
|
-
intent: {
|
|
74
|
-
type: "string",
|
|
75
|
-
description: "Optional. Filter to a specific intent (e.g. 'pica_works_create').",
|
|
76
|
-
},
|
|
77
|
-
limit: {
|
|
78
|
-
type: "number",
|
|
79
|
-
description: "Optional. Default 25, max 100.",
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
nextSteps: [
|
|
84
|
-
{
|
|
85
|
-
tool: "pica_continue",
|
|
86
|
-
reason: "Pick up where you left off — surfaces specific named open loops from the same substrate.",
|
|
87
|
-
when: "on_success",
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
executor: this.listMine.bind(this),
|
|
92
|
-
},
|
|
93
|
-
];
|
|
94
|
-
}
|
|
95
|
-
async listMine(args) {
|
|
96
|
-
const limitArg = typeof args.limit === "number" ? args.limit : undefined;
|
|
97
|
-
const limit = limitArg !== undefined ? Math.min(Math.max(limitArg, 1), 100) : undefined;
|
|
98
|
-
const rawRows = await this.pica.assistantInteractions.listRecent({
|
|
99
|
-
sessionId: typeof args.session_id === "string" ? args.session_id : undefined,
|
|
100
|
-
since: typeof args.since === "string" ? args.since : undefined,
|
|
101
|
-
success: typeof args.success === "boolean" ? args.success : undefined,
|
|
102
|
-
intent: typeof args.intent === "string" ? args.intent : undefined,
|
|
103
|
-
limit,
|
|
104
|
-
});
|
|
105
|
-
// ADR-230 — derive tier per row at read time from tools_used
|
|
106
|
-
// (assistant_interactions has no tier column; Stage 1 picked
|
|
107
|
-
// Option A — registry-derived lookup over column denormalisation).
|
|
108
|
-
const rows = Array.isArray(rawRows)
|
|
109
|
-
? rawRows.map((r) => ({
|
|
110
|
-
...r,
|
|
111
|
-
tier: dominantTier((Array.isArray(r.tools_used) ? r.tools_used : []), this.getTier),
|
|
112
|
-
}))
|
|
113
|
-
: rawRows;
|
|
114
|
-
if (!Array.isArray(rows) || rows.length === 0) {
|
|
115
|
-
return {
|
|
116
|
-
content: [
|
|
117
|
-
{
|
|
118
|
-
type: "text",
|
|
119
|
-
text: "No recent activity for your account. Once you start asking PICA to do things, this is where you'll see them.",
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
structuredContent: {
|
|
123
|
-
kind: "pica.card.my_recent_questions",
|
|
124
|
-
version: 1,
|
|
125
|
-
data: { count: 0, interactions: [] },
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
const lines = rows.slice(0, 10).map((r) => {
|
|
130
|
-
const tag = r.success
|
|
131
|
-
? r.required_confirmation && r.was_confirmed !== true
|
|
132
|
-
? "⏳ awaiting"
|
|
133
|
-
: "✓"
|
|
134
|
-
: "✗";
|
|
135
|
-
const client = r.client_name
|
|
136
|
-
? `${r.client_name}${r.client_version ? ` v${r.client_version}` : ""}`
|
|
137
|
-
: "unknown client";
|
|
138
|
-
const summary = r.result_summary ?? r.prompt_excerpt ?? r.intent;
|
|
139
|
-
const tools = Array.isArray(r.tools_used) && r.tools_used.length > 0
|
|
140
|
-
? ` — \`${r.tools_used.slice(0, 3).join(", ")}\``
|
|
141
|
-
: "";
|
|
142
|
-
const when = formatWhen(r.created_at);
|
|
143
|
-
return `[${tag}] ${client} ${when}: ${truncate(summary, 140)}${tools}`;
|
|
144
|
-
});
|
|
145
|
-
const more = rows.length > 10
|
|
146
|
-
? `\n\n_+${rows.length - 10} more — pass a higher limit to see them._`
|
|
147
|
-
: "";
|
|
148
|
-
return {
|
|
149
|
-
content: [
|
|
150
|
-
{
|
|
151
|
-
type: "text",
|
|
152
|
-
text: `${rows.length} recent interaction${rows.length === 1 ? "" : "s"}:\n\n` +
|
|
153
|
-
`${lines.join("\n")}${more}`,
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
structuredContent: {
|
|
157
|
-
kind: "pica.card.my_recent_questions",
|
|
158
|
-
version: 1,
|
|
159
|
-
data: {
|
|
160
|
-
count: rows.length,
|
|
161
|
-
interactions: rows,
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function truncate(text, max) {
|
|
168
|
-
if (text.length <= max)
|
|
169
|
-
return text;
|
|
170
|
-
return text.slice(0, max - 1) + "…";
|
|
171
|
-
}
|
|
172
|
-
function formatWhen(iso) {
|
|
173
|
-
const then = new Date(iso).getTime();
|
|
174
|
-
const diffMs = Date.now() - then;
|
|
175
|
-
const minutes = Math.floor(diffMs / 60000);
|
|
176
|
-
if (minutes < 1)
|
|
177
|
-
return "just now";
|
|
178
|
-
if (minutes < 60)
|
|
179
|
-
return `${minutes}m ago`;
|
|
180
|
-
const hours = Math.floor(minutes / 60);
|
|
181
|
-
if (hours < 24)
|
|
182
|
-
return `${hours}h ago`;
|
|
183
|
-
const days = Math.floor(hours / 24);
|
|
184
|
-
return `${days}d ago`;
|
|
185
|
-
}
|
|
186
|
-
//# sourceMappingURL=my-recent-questions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"my-recent-questions.js","sourceRoot":"","sources":["../../src/tools/my-recent-questions.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAkB7D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,SAAS,GAAyB;IACtC,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,WAAW,EAAE,CAAC;CACf,CAAC;AAEF,SAAS,YAAY,CACnB,KAAe,EACf,OAA2C;IAE3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IAC/D,IAAI,OAAO,GAAS,MAAM,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QAClC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YACzC,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,OAAO,sBAAsB;IACzB,IAAI,CAAa;IACjB,OAAO,CAAqC;IAEpD,YACE,IAAgB,EAChB,OAA2C;QAE3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gB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C3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,OAAO,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACpC,OAAO,GAAG,IAAI,OAAO,CAAC;AACxB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ADR-231 — User-Initiated Asset Sharing via Creator MCP.
|
|
3
|
-
*
|
|
4
|
-
* Tool: pica_share_send
|
|
5
|
-
*
|
|
6
|
-
* Atlas vernacular phrasings (registered separately via Atlas seed,
|
|
7
|
-
* but documented here for traceability):
|
|
8
|
-
* - "send <asset> to <name>"
|
|
9
|
-
* - "share <asset> with <name>"
|
|
10
|
-
* - "email <asset> to <person>"
|
|
11
|
-
* - "shoot <asset> over to <name>"
|
|
12
|
-
* - "send <asset> to <email>"
|
|
13
|
-
* - "forward <asset> to <person>"
|
|
14
|
-
*
|
|
15
|
-
* Per ADR-226 vernacular Atlas substrate.
|
|
16
|
-
*/
|
|
17
|
-
import { PicaClient } from "@withpica/mcp-sdk";
|
|
18
|
-
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
19
|
-
export declare class ShareSendTools {
|
|
20
|
-
private pica;
|
|
21
|
-
constructor(pica: PicaClient);
|
|
22
|
-
getTools(): Array<{
|
|
23
|
-
definition: ToolDefinition;
|
|
24
|
-
executor: ToolExecutor;
|
|
25
|
-
}>;
|
|
26
|
-
private shareSend;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=share-send.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"share-send.d.ts","sourceRoot":"","sources":["../../src/tools/share-send.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,cAAc;IACb,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAmF3D,SAAS;CA+BxB"}
|