@withpica/mcp-server 1.3.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 +1850 -0
- package/README.md +304 -0
- package/assets/fonts/GeistSans-Light.woff2 +0 -0
- package/assets/fonts/InstrumentSerif-Italic.woff2 +0 -0
- package/assets/fonts/InstrumentSerif-Regular.woff2 +0 -0
- package/dist/apps/download.d.ts +2 -0
- package/dist/apps/download.d.ts.map +1 -0
- package/dist/apps/download.js +125 -0
- package/dist/apps/download.js.map +1 -0
- package/dist/apps/generated/shared-bundle.d.ts +5 -0
- package/dist/apps/generated/shared-bundle.d.ts.map +1 -0
- package/dist/apps/generated/shared-bundle.js +7 -0
- package/dist/apps/generated/shared-bundle.js.map +1 -0
- package/dist/apps/release.d.ts +2 -0
- package/dist/apps/release.d.ts.map +1 -0
- package/dist/apps/release.js +69 -0
- package/dist/apps/release.js.map +1 -0
- package/dist/apps/shared.d.ts +15 -0
- package/dist/apps/shared.d.ts.map +1 -0
- package/dist/apps/shared.js +480 -0
- package/dist/apps/shared.js.map +1 -0
- package/dist/apps/upload.d.ts +2 -0
- package/dist/apps/upload.d.ts.map +1 -0
- package/dist/apps/upload.js +280 -0
- package/dist/apps/upload.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +73 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/index.d.ts +86 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +645 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/agent-guide.d.ts +15 -0
- package/dist/resources/agent-guide.d.ts.map +1 -0
- package/dist/resources/agent-guide.js +284 -0
- package/dist/resources/agent-guide.js.map +1 -0
- package/dist/resources/index.d.ts +66 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +510 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/llms-primer.d.ts +2 -0
- package/dist/resources/llms-primer.d.ts.map +1 -0
- package/dist/resources/llms-primer.js +68 -0
- package/dist/resources/llms-primer.js.map +1 -0
- package/dist/resources/required-schemas.generated.d.ts +455 -0
- package/dist/resources/required-schemas.generated.d.ts.map +1 -0
- package/dist/resources/required-schemas.generated.js +1041 -0
- package/dist/resources/required-schemas.generated.js.map +1 -0
- package/dist/resources/required-schemas.source.d.ts +53 -0
- package/dist/resources/required-schemas.source.d.ts.map +1 -0
- package/dist/resources/required-schemas.source.js +493 -0
- package/dist/resources/required-schemas.source.js.map +1 -0
- package/dist/resources/welcome.d.ts +14 -0
- package/dist/resources/welcome.d.ts.map +1 -0
- package/dist/resources/welcome.js +26 -0
- package/dist/resources/welcome.js.map +1 -0
- package/dist/server-instructions.d.ts +60 -0
- package/dist/server-instructions.d.ts.map +1 -0
- package/dist/server-instructions.js +93 -0
- package/dist/server-instructions.js.map +1 -0
- package/dist/server.d.ts +52 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +334 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/access-simulate.d.ts +23 -0
- package/dist/tools/access-simulate.d.ts.map +1 -0
- package/dist/tools/access-simulate.js +162 -0
- package/dist/tools/access-simulate.js.map +1 -0
- package/dist/tools/agent-identity.d.ts +36 -0
- package/dist/tools/agent-identity.d.ts.map +1 -0
- package/dist/tools/agent-identity.js +274 -0
- package/dist/tools/agent-identity.js.map +1 -0
- package/dist/tools/agreement-types.d.ts +27 -0
- package/dist/tools/agreement-types.d.ts.map +1 -0
- package/dist/tools/agreement-types.js +281 -0
- package/dist/tools/agreement-types.js.map +1 -0
- package/dist/tools/agreements.d.ts +20 -0
- package/dist/tools/agreements.d.ts.map +1 -0
- package/dist/tools/agreements.js +282 -0
- package/dist/tools/agreements.js.map +1 -0
- package/dist/tools/analytics.d.ts +20 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +130 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/app-tools.d.ts +15 -0
- package/dist/tools/app-tools.d.ts.map +1 -0
- package/dist/tools/app-tools.js +388 -0
- package/dist/tools/app-tools.js.map +1 -0
- package/dist/tools/assets.d.ts +25 -0
- package/dist/tools/assets.d.ts.map +1 -0
- package/dist/tools/assets.js +454 -0
- package/dist/tools/assets.js.map +1 -0
- package/dist/tools/audio-files.d.ts +20 -0
- package/dist/tools/audio-files.d.ts.map +1 -0
- package/dist/tools/audio-files.js +409 -0
- package/dist/tools/audio-files.js.map +1 -0
- package/dist/tools/audit.d.ts +19 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +58 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/auth.d.ts +22 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +212 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/bulk.d.ts +22 -0
- package/dist/tools/bulk.d.ts.map +1 -0
- package/dist/tools/bulk.js +164 -0
- package/dist/tools/bulk.js.map +1 -0
- package/dist/tools/calendar.d.ts +15 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +68 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/collaborators.d.ts +21 -0
- package/dist/tools/collaborators.d.ts.map +1 -0
- package/dist/tools/collaborators.js +381 -0
- package/dist/tools/collaborators.js.map +1 -0
- package/dist/tools/comparisons.d.ts +22 -0
- package/dist/tools/comparisons.d.ts.map +1 -0
- package/dist/tools/comparisons.js +80 -0
- package/dist/tools/comparisons.js.map +1 -0
- package/dist/tools/credits.d.ts +39 -0
- package/dist/tools/credits.d.ts.map +1 -0
- package/dist/tools/credits.js +541 -0
- package/dist/tools/credits.js.map +1 -0
- package/dist/tools/custody-hints.d.ts +16 -0
- package/dist/tools/custody-hints.d.ts.map +1 -0
- package/dist/tools/custody-hints.js +27 -0
- package/dist/tools/custody-hints.js.map +1 -0
- package/dist/tools/custody.d.ts +38 -0
- package/dist/tools/custody.d.ts.map +1 -0
- package/dist/tools/custody.js +281 -0
- package/dist/tools/custody.js.map +1 -0
- package/dist/tools/dashboard.d.ts +22 -0
- package/dist/tools/dashboard.d.ts.map +1 -0
- package/dist/tools/dashboard.js +258 -0
- package/dist/tools/dashboard.js.map +1 -0
- package/dist/tools/directory.d.ts +15 -0
- package/dist/tools/directory.d.ts.map +1 -0
- package/dist/tools/directory.js +107 -0
- package/dist/tools/directory.js.map +1 -0
- package/dist/tools/discovery.d.ts +49 -0
- package/dist/tools/discovery.d.ts.map +1 -0
- package/dist/tools/discovery.js +851 -0
- package/dist/tools/discovery.js.map +1 -0
- package/dist/tools/disputes.d.ts +18 -0
- package/dist/tools/disputes.d.ts.map +1 -0
- package/dist/tools/disputes.js +62 -0
- package/dist/tools/disputes.js.map +1 -0
- package/dist/tools/documents.d.ts +15 -0
- package/dist/tools/documents.d.ts.map +1 -0
- package/dist/tools/documents.js +37 -0
- package/dist/tools/documents.js.map +1 -0
- package/dist/tools/duplicates.d.ts +25 -0
- package/dist/tools/duplicates.d.ts.map +1 -0
- package/dist/tools/duplicates.js +108 -0
- package/dist/tools/duplicates.js.map +1 -0
- package/dist/tools/enrichment.d.ts +56 -0
- package/dist/tools/enrichment.d.ts.map +1 -0
- package/dist/tools/enrichment.js +616 -0
- package/dist/tools/enrichment.js.map +1 -0
- package/dist/tools/exports.d.ts +19 -0
- package/dist/tools/exports.d.ts.map +1 -0
- package/dist/tools/exports.js +184 -0
- package/dist/tools/exports.js.map +1 -0
- package/dist/tools/feedback.d.ts +22 -0
- package/dist/tools/feedback.d.ts.map +1 -0
- package/dist/tools/feedback.js +100 -0
- package/dist/tools/feedback.js.map +1 -0
- package/dist/tools/forbidden-keywords.d.ts +62 -0
- package/dist/tools/forbidden-keywords.d.ts.map +1 -0
- package/dist/tools/forbidden-keywords.js +99 -0
- package/dist/tools/forbidden-keywords.js.map +1 -0
- package/dist/tools/gap-hints.d.ts +53 -0
- package/dist/tools/gap-hints.d.ts.map +1 -0
- package/dist/tools/gap-hints.js +245 -0
- package/dist/tools/gap-hints.js.map +1 -0
- package/dist/tools/groups.d.ts +29 -0
- package/dist/tools/groups.d.ts.map +1 -0
- package/dist/tools/groups.js +186 -0
- package/dist/tools/groups.js.map +1 -0
- package/dist/tools/import-documents.d.ts +21 -0
- package/dist/tools/import-documents.d.ts.map +1 -0
- package/dist/tools/import-documents.js +206 -0
- package/dist/tools/import-documents.js.map +1 -0
- package/dist/tools/import.d.ts +31 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +610 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/index.d.ts +293 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +1182 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/integrations.d.ts +19 -0
- package/dist/tools/integrations.d.ts.map +1 -0
- package/dist/tools/integrations.js +120 -0
- package/dist/tools/integrations.js.map +1 -0
- package/dist/tools/labels.d.ts +20 -0
- package/dist/tools/labels.d.ts.map +1 -0
- package/dist/tools/labels.js +48 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/licensing.d.ts +40 -0
- package/dist/tools/licensing.d.ts.map +1 -0
- package/dist/tools/licensing.js +436 -0
- package/dist/tools/licensing.js.map +1 -0
- package/dist/tools/memory.d.ts +21 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +120 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/metadata.d.ts +15 -0
- package/dist/tools/metadata.d.ts.map +1 -0
- package/dist/tools/metadata.js +1532 -0
- package/dist/tools/metadata.js.map +1 -0
- package/dist/tools/multimedia.d.ts +19 -0
- package/dist/tools/multimedia.d.ts.map +1 -0
- package/dist/tools/multimedia.js +371 -0
- package/dist/tools/multimedia.js.map +1 -0
- package/dist/tools/my-reported-issues.d.ts +32 -0
- package/dist/tools/my-reported-issues.d.ts.map +1 -0
- package/dist/tools/my-reported-issues.js +123 -0
- package/dist/tools/my-reported-issues.js.map +1 -0
- package/dist/tools/notes.d.ts +21 -0
- package/dist/tools/notes.d.ts.map +1 -0
- package/dist/tools/notes.js +115 -0
- package/dist/tools/notes.js.map +1 -0
- package/dist/tools/notifications.d.ts +28 -0
- package/dist/tools/notifications.d.ts.map +1 -0
- package/dist/tools/notifications.js +417 -0
- package/dist/tools/notifications.js.map +1 -0
- package/dist/tools/onboarding.d.ts +24 -0
- package/dist/tools/onboarding.d.ts.map +1 -0
- package/dist/tools/onboarding.js +81 -0
- package/dist/tools/onboarding.js.map +1 -0
- package/dist/tools/people.d.ts +254 -0
- package/dist/tools/people.d.ts.map +1 -0
- package/dist/tools/people.js +481 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/tools/projects.d.ts +20 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +316 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/public-filter.d.ts +43 -0
- package/dist/tools/public-filter.d.ts.map +1 -0
- package/dist/tools/public-filter.js +356 -0
- package/dist/tools/public-filter.js.map +1 -0
- package/dist/tools/publishers.d.ts +30 -0
- package/dist/tools/publishers.d.ts.map +1 -0
- package/dist/tools/publishers.js +105 -0
- package/dist/tools/publishers.js.map +1 -0
- package/dist/tools/purchases.d.ts +27 -0
- package/dist/tools/purchases.d.ts.map +1 -0
- package/dist/tools/purchases.js +9 -0
- package/dist/tools/purchases.js.map +1 -0
- package/dist/tools/recording-attribution-hints.d.ts +24 -0
- package/dist/tools/recording-attribution-hints.d.ts.map +1 -0
- package/dist/tools/recording-attribution-hints.js +27 -0
- package/dist/tools/recording-attribution-hints.js.map +1 -0
- package/dist/tools/recordings.d.ts +96 -0
- package/dist/tools/recordings.d.ts.map +1 -0
- package/dist/tools/recordings.js +564 -0
- package/dist/tools/recordings.js.map +1 -0
- package/dist/tools/recovery-hints.d.ts +40 -0
- package/dist/tools/recovery-hints.d.ts.map +1 -0
- package/dist/tools/recovery-hints.js +827 -0
- package/dist/tools/recovery-hints.js.map +1 -0
- package/dist/tools/release-rich.d.ts +31 -0
- package/dist/tools/release-rich.d.ts.map +1 -0
- package/dist/tools/release-rich.js +245 -0
- package/dist/tools/release-rich.js.map +1 -0
- package/dist/tools/releases.d.ts +36 -0
- package/dist/tools/releases.d.ts.map +1 -0
- package/dist/tools/releases.js +649 -0
- package/dist/tools/releases.js.map +1 -0
- package/dist/tools/report-issue.d.ts +21 -0
- package/dist/tools/report-issue.d.ts.map +1 -0
- package/dist/tools/report-issue.js +101 -0
- package/dist/tools/report-issue.js.map +1 -0
- package/dist/tools/royalties.d.ts +23 -0
- package/dist/tools/royalties.d.ts.map +1 -0
- package/dist/tools/royalties.js +262 -0
- package/dist/tools/royalties.js.map +1 -0
- package/dist/tools/search.d.ts +30 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +115 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/send.d.ts +17 -0
- package/dist/tools/send.d.ts.map +1 -0
- package/dist/tools/send.js +188 -0
- package/dist/tools/send.js.map +1 -0
- package/dist/tools/sessions.d.ts +18 -0
- package/dist/tools/sessions.d.ts.map +1 -0
- package/dist/tools/sessions.js +153 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/settings.d.ts +23 -0
- package/dist/tools/settings.d.ts.map +1 -0
- package/dist/tools/settings.js +365 -0
- package/dist/tools/settings.js.map +1 -0
- package/dist/tools/share-links.d.ts +22 -0
- package/dist/tools/share-links.d.ts.map +1 -0
- package/dist/tools/share-links.js +188 -0
- package/dist/tools/share-links.js.map +1 -0
- package/dist/tools/signup.d.ts +26 -0
- package/dist/tools/signup.d.ts.map +1 -0
- package/dist/tools/signup.js +266 -0
- package/dist/tools/signup.js.map +1 -0
- package/dist/tools/split-sheets.d.ts +25 -0
- package/dist/tools/split-sheets.d.ts.map +1 -0
- package/dist/tools/split-sheets.js +309 -0
- package/dist/tools/split-sheets.js.map +1 -0
- package/dist/tools/storage-config.d.ts +13 -0
- package/dist/tools/storage-config.d.ts.map +1 -0
- package/dist/tools/storage-config.js +245 -0
- package/dist/tools/storage-config.js.map +1 -0
- package/dist/tools/subscription.d.ts +60 -0
- package/dist/tools/subscription.d.ts.map +1 -0
- package/dist/tools/subscription.js +440 -0
- package/dist/tools/subscription.js.map +1 -0
- package/dist/tools/sync-placements.d.ts +31 -0
- package/dist/tools/sync-placements.d.ts.map +1 -0
- package/dist/tools/sync-placements.js +431 -0
- package/dist/tools/sync-placements.js.map +1 -0
- package/dist/tools/team.d.ts +22 -0
- package/dist/tools/team.d.ts.map +1 -0
- package/dist/tools/team.js +144 -0
- package/dist/tools/team.js.map +1 -0
- package/dist/tools/telegram.d.ts +21 -0
- package/dist/tools/telegram.d.ts.map +1 -0
- package/dist/tools/telegram.js +144 -0
- package/dist/tools/telegram.js.map +1 -0
- package/dist/tools/uploads.d.ts +17 -0
- package/dist/tools/uploads.d.ts.map +1 -0
- package/dist/tools/uploads.js +165 -0
- package/dist/tools/uploads.js.map +1 -0
- package/dist/tools/works.d.ts +71 -0
- package/dist/tools/works.d.ts.map +1 -0
- package/dist/tools/works.js +694 -0
- package/dist/tools/works.js.map +1 -0
- package/package.json +54 -0
- package/scripts/build-required-schemas.ts +233 -0
- package/scripts/bundle-apps.ts +61 -0
- package/scripts/refresh-schema-mirror.ts +182 -0
- package/server.json +20 -0
|
@@ -0,0 +1,162 @@
|
|
|
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
|
+
description: "Simulate who would see what — for any work, recording, person, or " +
|
|
17
|
+
"release, given a hypothetical action (view, share-link preview, " +
|
|
18
|
+
"claim, grant) and a recipient configuration, returns the visible " +
|
|
19
|
+
"and hidden fields plus the chain of rules that produced the answer. " +
|
|
20
|
+
"Read-only — never mutates state. Use BEFORE creating a share link " +
|
|
21
|
+
"to verify the recipient sees what you intend, or BEFORE claiming " +
|
|
22
|
+
"custody to see what changes. v1 ships real share_link_preview " +
|
|
23
|
+
"logic for works; other paths return a stable scaffolded shape.",
|
|
24
|
+
workflows: "infrastructure",
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: "object",
|
|
27
|
+
properties: {
|
|
28
|
+
entity_type: {
|
|
29
|
+
type: "string",
|
|
30
|
+
enum: [...ENTITY_TYPES],
|
|
31
|
+
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.",
|
|
32
|
+
},
|
|
33
|
+
entity_id: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "UUID of the entity. Must belong to the caller's organisation — cross-org IDs return entity_not_found rather than leaking existence.",
|
|
36
|
+
},
|
|
37
|
+
action: {
|
|
38
|
+
type: "string",
|
|
39
|
+
enum: [...ACTIONS],
|
|
40
|
+
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.",
|
|
41
|
+
},
|
|
42
|
+
recipient: {
|
|
43
|
+
type: "object",
|
|
44
|
+
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.",
|
|
45
|
+
properties: {
|
|
46
|
+
type: {
|
|
47
|
+
type: "string",
|
|
48
|
+
enum: [...RECIPIENT_TYPES],
|
|
49
|
+
description: "Recipient type — 'user' (authenticated user_id), 'anonymous' (no auth), 'share_link' (hypothetical share-link config).",
|
|
50
|
+
},
|
|
51
|
+
user_id: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "Recipient user UUID, when type='user'. Optional otherwise.",
|
|
54
|
+
},
|
|
55
|
+
org_id: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Recipient organisation UUID, when simulating an action that targets an org (e.g. 'grant'). Optional otherwise.",
|
|
58
|
+
},
|
|
59
|
+
share_config: {
|
|
60
|
+
type: "object",
|
|
61
|
+
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.",
|
|
62
|
+
properties: {
|
|
63
|
+
access_type: {
|
|
64
|
+
type: "string",
|
|
65
|
+
enum: ["private", "limited", "public"],
|
|
66
|
+
description: "Recipient scope — 'private' (allowed_person_ids only), 'limited' (sent_to_emails only), 'public' (anyone with link).",
|
|
67
|
+
},
|
|
68
|
+
allow_download: {
|
|
69
|
+
type: "boolean",
|
|
70
|
+
description: "When true, the recipient can download original audio files. Pair with watermark_audio=true for pre-release pitches.",
|
|
71
|
+
},
|
|
72
|
+
allow_streaming: {
|
|
73
|
+
type: "boolean",
|
|
74
|
+
description: "When true, the recipient can stream audio inline.",
|
|
75
|
+
},
|
|
76
|
+
allow_comments: {
|
|
77
|
+
type: "boolean",
|
|
78
|
+
description: "When true, the recipient sees the discussion thread and can post comments.",
|
|
79
|
+
},
|
|
80
|
+
allow_view_collaborators: {
|
|
81
|
+
type: "boolean",
|
|
82
|
+
description: "When true, the recipient sees the credit lines, splits, and attestation status.",
|
|
83
|
+
},
|
|
84
|
+
allow_view_financials: {
|
|
85
|
+
type: "boolean",
|
|
86
|
+
description: "When true, the recipient sees earnings, advances, and royalty statements. The most common reason a recipient sees less than expected.",
|
|
87
|
+
},
|
|
88
|
+
watermark_audio: {
|
|
89
|
+
type: "boolean",
|
|
90
|
+
description: "When true, audio surfaces are mixed with an inaudible watermark identifier.",
|
|
91
|
+
},
|
|
92
|
+
notify_on_access: {
|
|
93
|
+
type: "boolean",
|
|
94
|
+
description: "When true, the link's creator gets notified each time the recipient accesses it.",
|
|
95
|
+
},
|
|
96
|
+
allowed_person_ids: {
|
|
97
|
+
type: "array",
|
|
98
|
+
items: { type: "string" },
|
|
99
|
+
description: "Person UUIDs allowed to access when access_type='private'.",
|
|
100
|
+
},
|
|
101
|
+
sent_to_emails: {
|
|
102
|
+
type: "array",
|
|
103
|
+
items: { type: "string" },
|
|
104
|
+
description: "Email addresses the link was sent to when access_type='limited'.",
|
|
105
|
+
},
|
|
106
|
+
max_views: {
|
|
107
|
+
type: "number",
|
|
108
|
+
description: "Cap on total views; null/omitted for unlimited. <=0 makes the link unusable.",
|
|
109
|
+
},
|
|
110
|
+
expires_at: {
|
|
111
|
+
type: "string",
|
|
112
|
+
description: "ISO timestamp; recipients see an expired page after this time.",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
required: ["access_type"],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
required: ["type"],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
required: ["entity_type", "entity_id", "action", "recipient"],
|
|
122
|
+
},
|
|
123
|
+
annotations: {
|
|
124
|
+
readOnlyHint: true,
|
|
125
|
+
idempotentHint: true,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
executor: this.simulate.bind(this),
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
async simulate(args) {
|
|
133
|
+
if (!args.entity_type || !ENTITY_TYPES.includes(args.entity_type)) {
|
|
134
|
+
return formatValidationError({
|
|
135
|
+
entity_type: `must be one of: ${ENTITY_TYPES.join(", ")}`,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (!args.entity_id || typeof args.entity_id !== "string") {
|
|
139
|
+
return formatValidationError({ entity_id: "is required" });
|
|
140
|
+
}
|
|
141
|
+
if (!args.action || !ACTIONS.includes(args.action)) {
|
|
142
|
+
return formatValidationError({
|
|
143
|
+
action: `must be one of: ${ACTIONS.join(", ")}`,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (!args.recipient ||
|
|
147
|
+
typeof args.recipient !== "object" ||
|
|
148
|
+
!RECIPIENT_TYPES.includes(args.recipient.type)) {
|
|
149
|
+
return formatValidationError({
|
|
150
|
+
recipient: `recipient.type must be one of: ${RECIPIENT_TYPES.join(", ")}`,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const result = await this.pica.accessSimulate.simulate(args);
|
|
154
|
+
const summary = result.not_yet_supported
|
|
155
|
+
? `Access simulation scaffolded (v1 stub) — ${result.reasons[0]?.detail ?? "see reasons"}`
|
|
156
|
+
: result.visible
|
|
157
|
+
? `Access simulated — ${result.visible_fields.length} field(s) visible, ${result.hidden_fields.length} hidden, ${result.warnings.length} warning(s)`
|
|
158
|
+
: `Access denied — ${result.reasons[0]?.detail ?? "see reasons"}`;
|
|
159
|
+
return formatSuccess(summary, result);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=access-simulate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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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G,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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Identity Tools — MCP surface for ADR-185 Parts 1+2.
|
|
3
|
+
*
|
|
4
|
+
* Five session-auth-only tools (Part 1 shipped 1-3, Part 2 adds 4-5):
|
|
5
|
+
* - pica_create_agent_identity
|
|
6
|
+
* - pica_issue_agent_grant
|
|
7
|
+
* - pica_list_my_agent_grants
|
|
8
|
+
* - pica_revoke_agent_grant (Part 2)
|
|
9
|
+
* - pica_get_agent_activity (Part 2)
|
|
10
|
+
*
|
|
11
|
+
* All five route through the PICA HTTP API. The backing routes refuse
|
|
12
|
+
* `pica_grant_` callers with 403 `session_auth_required` per AC 12, so
|
|
13
|
+
* the session-auth-only guarantee is enforced once at the API layer and
|
|
14
|
+
* honoured by both stdio and HTTP MCP transports automatically. The
|
|
15
|
+
* HTTP dispatcher in app/api/mcp/route.ts also rejects at the tool layer
|
|
16
|
+
* via the SESSION_AUTH_ONLY_TOOLS set (belt-and-braces).
|
|
17
|
+
*
|
|
18
|
+
* Subject (user_id) is derived from the auth context — never from tool
|
|
19
|
+
* arguments (ADR-184 rule 1 / ADR-185 rule 1).
|
|
20
|
+
*/
|
|
21
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
22
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
23
|
+
export declare class AgentIdentityTools {
|
|
24
|
+
private pica;
|
|
25
|
+
constructor(pica: PicaClient);
|
|
26
|
+
getTools(): Array<{
|
|
27
|
+
definition: ToolDefinition;
|
|
28
|
+
executor: ToolExecutor;
|
|
29
|
+
}>;
|
|
30
|
+
private createIdentity;
|
|
31
|
+
private issueGrant;
|
|
32
|
+
private listMyGrants;
|
|
33
|
+
private revokeGrant;
|
|
34
|
+
private getActivity;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=agent-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-identity.d.ts","sourceRoot":"","sources":["../../src/tools/agent-identity.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAEtE,qBAAa,kBAAkB;IAC7B,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;YA2E3D,cAAc;YAmCd,UAAU;YAsEV,YAAY;YAmCZ,WAAW;YA8BX,WAAW;CAgD1B"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
import { CREATE_AGENT_IDENTITY_WRITE_PROPERTIES, CREATE_AGENT_IDENTITY_REQUIRED, ISSUE_AGENT_GRANT_WRITE_PROPERTIES, ISSUE_AGENT_GRANT_REQUIRED, LIST_MY_AGENT_GRANTS_WRITE_PROPERTIES, LIST_MY_AGENT_GRANTS_REQUIRED, REVOKE_AGENT_GRANT_WRITE_PROPERTIES, REVOKE_AGENT_GRANT_REQUIRED, GET_AGENT_ACTIVITY_WRITE_PROPERTIES, GET_AGENT_ACTIVITY_REQUIRED, } from "@withpica/mcp-utils";
|
|
3
|
+
export class AgentIdentityTools {
|
|
4
|
+
pica;
|
|
5
|
+
constructor(pica) {
|
|
6
|
+
this.pica = pica;
|
|
7
|
+
}
|
|
8
|
+
getTools() {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
definition: {
|
|
12
|
+
name: "pica_create_agent_identity",
|
|
13
|
+
description: "Create a named agent identity (e.g. 'Claude on laptop') that grants can be issued against. Session-auth only — refused if called with a pica_grant_ token. Subject is the authenticated user; caller-supplied user_id is dropped.",
|
|
14
|
+
workflows: "infrastructure",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: CREATE_AGENT_IDENTITY_WRITE_PROPERTIES,
|
|
18
|
+
required: CREATE_AGENT_IDENTITY_REQUIRED,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
executor: this.createIdentity.bind(this),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
definition: {
|
|
25
|
+
name: "pica_issue_agent_grant",
|
|
26
|
+
description: "Issue a capability grant against an identity you own. Returns a one-time grant_token (format pica_grant_<random>) — save it immediately; it is never shown again. Default expiry 90 days, max 365. Session-auth only.",
|
|
27
|
+
workflows: "infrastructure",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: ISSUE_AGENT_GRANT_WRITE_PROPERTIES,
|
|
31
|
+
required: ISSUE_AGENT_GRANT_REQUIRED,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
executor: this.issueGrant.bind(this),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
definition: {
|
|
38
|
+
name: "pica_list_my_agent_grants",
|
|
39
|
+
description: "List your active agent grants. Returns non-secret fields only — tokens are never re-exposed after issue. Session-auth only.",
|
|
40
|
+
workflows: "infrastructure",
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: LIST_MY_AGENT_GRANTS_WRITE_PROPERTIES,
|
|
44
|
+
required: LIST_MY_AGENT_GRANTS_REQUIRED,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
executor: this.listMyGrants.bind(this),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
definition: {
|
|
51
|
+
name: "pica_revoke_agent_grant",
|
|
52
|
+
description: "Revoke one of your agent grants. Idempotent — revoking an already-revoked grant returns the same row. Revocation takes effect on the next request (within 60s). Session-auth only.",
|
|
53
|
+
workflows: "infrastructure",
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: REVOKE_AGENT_GRANT_WRITE_PROPERTIES,
|
|
57
|
+
required: REVOKE_AGENT_GRANT_REQUIRED,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
executor: this.revokeGrant.bind(this),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
definition: {
|
|
64
|
+
name: "pica_get_agent_activity",
|
|
65
|
+
description: "List agent_action_log rows whose grant's identity you own — your own provenance-stamped agent writes, sorted newest first. Optionally narrow by agent_identity_id or agent_grant_id. Paginated (default 50, max 500 per call). Session-auth only.",
|
|
66
|
+
workflows: "infrastructure",
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: "object",
|
|
69
|
+
properties: GET_AGENT_ACTIVITY_WRITE_PROPERTIES,
|
|
70
|
+
required: GET_AGENT_ACTIVITY_REQUIRED,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
executor: this.getActivity.bind(this),
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
async createIdentity(args) {
|
|
78
|
+
const displayName = typeof args.display_name === "string" ? args.display_name.trim() : "";
|
|
79
|
+
if (!displayName) {
|
|
80
|
+
return {
|
|
81
|
+
content: [{ type: "text", text: "Error: display_name is required." }],
|
|
82
|
+
isError: true,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const clientFingerprint = typeof args.client_fingerprint === "string" &&
|
|
86
|
+
args.client_fingerprint.trim()
|
|
87
|
+
? args.client_fingerprint.trim()
|
|
88
|
+
: null;
|
|
89
|
+
const result = await this.pica.agentIdentity.createIdentity({
|
|
90
|
+
displayName,
|
|
91
|
+
clientFingerprint,
|
|
92
|
+
});
|
|
93
|
+
const data = result?.data ?? result;
|
|
94
|
+
return {
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: "text",
|
|
98
|
+
text: `Agent identity created: "${displayName}" (id: ${data?.id ?? "unknown"}). Issue a grant with pica_issue_agent_grant to start using it.`,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
structuredContent: {
|
|
102
|
+
kind: "pica.card.agent_identity_created",
|
|
103
|
+
version: 1,
|
|
104
|
+
data,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
async issueGrant(args) {
|
|
109
|
+
const agentIdentityId = typeof args.agent_identity_id === "string"
|
|
110
|
+
? args.agent_identity_id.trim()
|
|
111
|
+
: "";
|
|
112
|
+
if (!agentIdentityId) {
|
|
113
|
+
return {
|
|
114
|
+
content: [
|
|
115
|
+
{ type: "text", text: "Error: agent_identity_id is required." },
|
|
116
|
+
],
|
|
117
|
+
isError: true,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (!Array.isArray(args.scopes) || args.scopes.length === 0) {
|
|
121
|
+
return {
|
|
122
|
+
content: [
|
|
123
|
+
{
|
|
124
|
+
type: "text",
|
|
125
|
+
text: "Error: scopes must be a non-empty array of strings.",
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
isError: true,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const scopes = args.scopes.filter((s) => typeof s === "string");
|
|
132
|
+
if (scopes.length !== args.scopes.length) {
|
|
133
|
+
return {
|
|
134
|
+
content: [{ type: "text", text: "Error: scopes must be strings." }],
|
|
135
|
+
isError: true,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const expiresAt = typeof args.expires_at === "string" && args.expires_at.trim()
|
|
139
|
+
? args.expires_at
|
|
140
|
+
: null;
|
|
141
|
+
const result = await this.pica.agentIdentity.issueGrant({
|
|
142
|
+
agentIdentityId,
|
|
143
|
+
scopes,
|
|
144
|
+
expiresAt,
|
|
145
|
+
});
|
|
146
|
+
const data = result?.data ?? result;
|
|
147
|
+
// The plaintext token is in data.grant_token and is shown once.
|
|
148
|
+
// Surface it prominently in the text block so the caller (and
|
|
149
|
+
// through it the user) sees it without having to drill into the
|
|
150
|
+
// structured card.
|
|
151
|
+
return {
|
|
152
|
+
content: [
|
|
153
|
+
{
|
|
154
|
+
type: "text",
|
|
155
|
+
text: `Grant issued (id: ${data?.id ?? "unknown"}). ` +
|
|
156
|
+
`Expires: ${data?.expires_at ?? "n/a"}. ` +
|
|
157
|
+
`Scopes: ${scopes.join(", ")}.\n\n` +
|
|
158
|
+
`grant_token: ${data?.grant_token ?? ""}\n\n` +
|
|
159
|
+
`Save this token now — it will not be shown again. ` +
|
|
160
|
+
`Present it as Authorization: Bearer <token> on MCP requests.`,
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
structuredContent: {
|
|
164
|
+
kind: "pica.card.agent_grant_issued",
|
|
165
|
+
version: 1,
|
|
166
|
+
data,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
async listMyGrants(_args) {
|
|
171
|
+
const result = await this.pica.agentIdentity.listMyGrants();
|
|
172
|
+
const data = result?.data ?? result;
|
|
173
|
+
const rows = Array.isArray(data) ? data : [];
|
|
174
|
+
const lines = rows.length
|
|
175
|
+
? rows
|
|
176
|
+
.map((row) => {
|
|
177
|
+
const name = row?.identity?.display_name ?? "unnamed";
|
|
178
|
+
const scopes = Array.isArray(row?.scopes)
|
|
179
|
+
? row.scopes.join(", ")
|
|
180
|
+
: "";
|
|
181
|
+
const expiry = row?.expires_at
|
|
182
|
+
? `expires ${row.expires_at}`
|
|
183
|
+
: "no expiry";
|
|
184
|
+
const revoked = row?.revoked_at ? " [revoked]" : "";
|
|
185
|
+
return `- ${name} (${row?.id ?? "unknown"}): ${scopes}; ${expiry}${revoked}`;
|
|
186
|
+
})
|
|
187
|
+
.join("\n")
|
|
188
|
+
: "(no grants)";
|
|
189
|
+
return {
|
|
190
|
+
content: [
|
|
191
|
+
{
|
|
192
|
+
type: "text",
|
|
193
|
+
text: `Your agent grants (${rows.length}):\n${lines}`,
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
structuredContent: {
|
|
197
|
+
kind: "pica.card.agent_grants_list",
|
|
198
|
+
version: 1,
|
|
199
|
+
data: rows,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
async revokeGrant(args) {
|
|
204
|
+
const grantId = typeof args.grant_id === "string" ? args.grant_id.trim() : "";
|
|
205
|
+
if (!grantId) {
|
|
206
|
+
return {
|
|
207
|
+
content: [{ type: "text", text: "Error: grant_id is required." }],
|
|
208
|
+
isError: true,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const result = await this.pica.agentIdentity.revokeGrant({ grantId });
|
|
212
|
+
const data = result?.data ?? result;
|
|
213
|
+
return {
|
|
214
|
+
content: [
|
|
215
|
+
{
|
|
216
|
+
type: "text",
|
|
217
|
+
text: `Grant ${data?.id ?? grantId} revoked at ${data?.revoked_at ?? "now"}. ` +
|
|
218
|
+
`The next request using this token will be refused with 401 ` +
|
|
219
|
+
`within 60 seconds.`,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
structuredContent: {
|
|
223
|
+
kind: "pica.card.agent_grant_revoked",
|
|
224
|
+
version: 1,
|
|
225
|
+
data,
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
async getActivity(args) {
|
|
230
|
+
const agentIdentityId = typeof args.agent_identity_id === "string" &&
|
|
231
|
+
args.agent_identity_id.trim()
|
|
232
|
+
? args.agent_identity_id.trim()
|
|
233
|
+
: null;
|
|
234
|
+
const agentGrantId = typeof args.agent_grant_id === "string" && args.agent_grant_id.trim()
|
|
235
|
+
? args.agent_grant_id.trim()
|
|
236
|
+
: null;
|
|
237
|
+
const limit = typeof args.limit === "number" ? args.limit : undefined;
|
|
238
|
+
const offset = typeof args.offset === "number" ? args.offset : undefined;
|
|
239
|
+
const result = await this.pica.agentIdentity.getActivity({
|
|
240
|
+
agentIdentityId,
|
|
241
|
+
agentGrantId,
|
|
242
|
+
limit,
|
|
243
|
+
offset,
|
|
244
|
+
});
|
|
245
|
+
const data = result?.data ?? result;
|
|
246
|
+
const rows = Array.isArray(data) ? data : [];
|
|
247
|
+
const lines = rows.length
|
|
248
|
+
? rows
|
|
249
|
+
.map((row) => {
|
|
250
|
+
const name = row?.grant?.identity?.display_name ?? "unnamed";
|
|
251
|
+
const action = row?.action ?? "?";
|
|
252
|
+
const table = row?.target_table ?? "?";
|
|
253
|
+
const tool = row?.tool_name ?? "?";
|
|
254
|
+
const when = row?.created_at ?? "";
|
|
255
|
+
return `- ${when} ${name} ${action} ${table} via ${tool}`;
|
|
256
|
+
})
|
|
257
|
+
.join("\n")
|
|
258
|
+
: "(no activity yet — provenance is stamped once Part 3 wraps write tools)";
|
|
259
|
+
return {
|
|
260
|
+
content: [
|
|
261
|
+
{
|
|
262
|
+
type: "text",
|
|
263
|
+
text: `Your agent activity (${rows.length}):\n${lines}`,
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
structuredContent: {
|
|
267
|
+
kind: "pica.card.agent_activity",
|
|
268
|
+
version: 1,
|
|
269
|
+
data: rows,
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=agent-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-identity.js","sourceRoot":"","sources":["../../src/tools/agent-identity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,iBAAiB,EAAE;gBACjB,IAAI,EAAE,0BAA0B;gBAChC,OAAO,EAAE,CAAC;gBACV,IAAI,EAAE,IAAI;aACX;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agreement Types Tools — templates, producer agreements, and work-for-hire
|
|
3
|
+
*
|
|
4
|
+
* Unified CRUD via type-routed tools, plus template-specific operations
|
|
5
|
+
* (render, duplicate, set_default).
|
|
6
|
+
*/
|
|
7
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
8
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
9
|
+
export declare class AgreementTypesTools {
|
|
10
|
+
private pica;
|
|
11
|
+
constructor(pica: PicaClient);
|
|
12
|
+
private getResource;
|
|
13
|
+
private labelFor;
|
|
14
|
+
getTools(): Array<{
|
|
15
|
+
definition: ToolDefinition;
|
|
16
|
+
executor: ToolExecutor;
|
|
17
|
+
}>;
|
|
18
|
+
private query;
|
|
19
|
+
private inspect;
|
|
20
|
+
private create;
|
|
21
|
+
private update;
|
|
22
|
+
private delete;
|
|
23
|
+
private renderTemplate;
|
|
24
|
+
private duplicateTemplate;
|
|
25
|
+
private setDefaultTemplate;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=agreement-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agreement-types.d.ts","sourceRoot":"","sources":["../../src/tools/agreement-types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAetE,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,QAAQ;IAWhB,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAiN3D,KAAK;YAML,OAAO;YAMP,MAAM;YA8CN,MAAM;YAON,MAAM;YASN,cAAc;YAMd,iBAAiB;YAOjB,kBAAkB;CAMjC"}
|