@pitcher/cli-scripts 2.8.0 → 2.9.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/README.md +37 -0
- package/dist/index.js +2 -0
- package/dist/src/commands/mcp.d.ts +2 -0
- package/dist/src/commands/mcp.js +18 -0
- package/dist/src/mcp/env.d.ts +7 -0
- package/dist/src/mcp/env.js +13 -0
- package/dist/src/mcp/registry.d.ts +2 -0
- package/dist/src/mcp/registry.js +46 -0
- package/dist/src/mcp/result.d.ts +13 -0
- package/dist/src/mcp/result.js +20 -0
- package/dist/src/mcp/serve.d.ts +1 -0
- package/dist/src/mcp/serve.js +13 -0
- package/dist/src/mcp/server.d.ts +3 -0
- package/dist/src/mcp/server.js +41 -0
- package/dist/src/mcp/tools/analytics.d.ts +2 -0
- package/dist/src/mcp/tools/analytics.js +20 -0
- package/dist/src/mcp/tools/announcements.d.ts +2 -0
- package/dist/src/mcp/tools/announcements.js +32 -0
- package/dist/src/mcp/tools/canvases.d.ts +2 -0
- package/dist/src/mcp/tools/canvases.js +30 -0
- package/dist/src/mcp/tools/devSync.d.ts +2 -0
- package/dist/src/mcp/tools/devSync.js +53 -0
- package/dist/src/mcp/tools/dsr.d.ts +2 -0
- package/dist/src/mcp/tools/dsr.js +47 -0
- package/dist/src/mcp/tools/dsrLanding.d.ts +2 -0
- package/dist/src/mcp/tools/dsrLanding.js +45 -0
- package/dist/src/mcp/tools/emailTemplate.d.ts +2 -0
- package/dist/src/mcp/tools/emailTemplate.js +47 -0
- package/dist/src/mcp/tools/files.d.ts +2 -0
- package/dist/src/mcp/tools/files.js +65 -0
- package/dist/src/mcp/tools/folders.d.ts +2 -0
- package/dist/src/mcp/tools/folders.js +56 -0
- package/dist/src/mcp/tools/groups.d.ts +2 -0
- package/dist/src/mcp/tools/groups.js +60 -0
- package/dist/src/mcp/tools/instances.d.ts +2 -0
- package/dist/src/mcp/tools/instances.js +28 -0
- package/dist/src/mcp/tools/invitations.d.ts +2 -0
- package/dist/src/mcp/tools/invitations.js +23 -0
- package/dist/src/mcp/tools/memberships.d.ts +2 -0
- package/dist/src/mcp/tools/memberships.js +47 -0
- package/dist/src/mcp/tools/metadataTemplate.d.ts +2 -0
- package/dist/src/mcp/tools/metadataTemplate.js +42 -0
- package/dist/src/mcp/tools/org.d.ts +2 -0
- package/dist/src/mcp/tools/org.js +12 -0
- package/dist/src/mcp/tools/publishApp.d.ts +2 -0
- package/dist/src/mcp/tools/publishApp.js +39 -0
- package/dist/src/mcp/tools/roles.d.ts +2 -0
- package/dist/src/mcp/tools/roles.js +15 -0
- package/dist/src/mcp/tools/search.d.ts +2 -0
- package/dist/src/mcp/tools/search.js +16 -0
- package/dist/src/mcp/tools/sharedLinks.d.ts +2 -0
- package/dist/src/mcp/tools/sharedLinks.js +27 -0
- package/dist/src/mcp/tools/tags.d.ts +2 -0
- package/dist/src/mcp/tools/tags.js +20 -0
- package/dist/src/mcp/tools/themes.d.ts +2 -0
- package/dist/src/mcp/tools/themes.js +28 -0
- package/dist/src/mcp/tools/types.d.ts +15 -0
- package/dist/src/mcp/tools/types.js +1 -0
- package/dist/src/mcp/tools/users.d.ts +2 -0
- package/dist/src/mcp/tools/users.js +31 -0
- package/package.json +4 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runFoldersList, runFoldersGet, runFoldersCreate, runFoldersUpdate } from '../../commands/folders.js';
|
|
3
|
+
export const foldersTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_folders_list',
|
|
6
|
+
title: 'List folders',
|
|
7
|
+
description: 'List folders in an instance. Use to discover folder IDs before creating content or browsing structure.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
page: z.number().int().optional(),
|
|
11
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
12
|
+
},
|
|
13
|
+
run: runFoldersList,
|
|
14
|
+
readOnly: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'pitcher_folders_get',
|
|
18
|
+
title: 'Get a folder',
|
|
19
|
+
description: 'Retrieve a single folder by its ID, or the instance root folder via root + instanceId.',
|
|
20
|
+
inputShape: {
|
|
21
|
+
id: z.string().optional().describe('Folder ID (omit and set root=true for the instance root)'),
|
|
22
|
+
root: z.boolean().optional().describe('Fetch the instance root folder'),
|
|
23
|
+
instanceId: z.string().optional().describe('Instance ID (required with root)'),
|
|
24
|
+
},
|
|
25
|
+
run: runFoldersGet,
|
|
26
|
+
readOnly: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'pitcher_folders_create',
|
|
30
|
+
title: 'Create a folder',
|
|
31
|
+
description: 'Create a folder under a parent folder in an instance. Additive.',
|
|
32
|
+
inputShape: {
|
|
33
|
+
name: z.string().describe('Folder name (required)'),
|
|
34
|
+
parentFolderId: z.string().describe('Parent folder ID (required)'),
|
|
35
|
+
accessType: z.enum(['public', 'restricted', 'personal']).optional(),
|
|
36
|
+
rules: z.string().optional().describe('Smart-folder rules JSON array as a string'),
|
|
37
|
+
},
|
|
38
|
+
run: runFoldersCreate,
|
|
39
|
+
readOnly: false,
|
|
40
|
+
write: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'pitcher_folders_update',
|
|
44
|
+
title: 'Update a folder',
|
|
45
|
+
description: 'Update an existing folder by ID (name, access type, or smart-folder rules; rules replace existing).',
|
|
46
|
+
inputShape: {
|
|
47
|
+
id: z.string().describe('Folder ID'),
|
|
48
|
+
name: z.string().optional().describe('Folder name'),
|
|
49
|
+
accessType: z.enum(['public', 'restricted', 'personal']).optional(),
|
|
50
|
+
rules: z.string().optional().describe('Smart-folder rules JSON array as a string (replaces existing)'),
|
|
51
|
+
},
|
|
52
|
+
run: runFoldersUpdate,
|
|
53
|
+
readOnly: false,
|
|
54
|
+
write: true,
|
|
55
|
+
},
|
|
56
|
+
];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runGroupsList, runGroupsGet, runGroupsCreate, runGroupsAddUser, runGroupsListUsers, } from '../../commands/groups.js';
|
|
3
|
+
export const groupsTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_groups_list',
|
|
6
|
+
title: 'List content-distribution groups',
|
|
7
|
+
description: 'List content-distribution groups. Filter by instance.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().optional().describe('Filter by instance'),
|
|
10
|
+
page: z.number().int().optional().describe('Page number'),
|
|
11
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
12
|
+
},
|
|
13
|
+
run: runGroupsList,
|
|
14
|
+
readOnly: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'pitcher_groups_get',
|
|
18
|
+
title: 'Get a group',
|
|
19
|
+
description: 'Retrieve a single content-distribution group by its ID.',
|
|
20
|
+
inputShape: { id: z.string().describe('Group ID') },
|
|
21
|
+
run: runGroupsGet,
|
|
22
|
+
readOnly: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'pitcher_groups_create',
|
|
26
|
+
title: 'Create a group',
|
|
27
|
+
description: 'Create a content-distribution group in an instance. Additive.',
|
|
28
|
+
inputShape: {
|
|
29
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
30
|
+
name: z.string().describe('Group name (required)'),
|
|
31
|
+
},
|
|
32
|
+
run: runGroupsCreate,
|
|
33
|
+
readOnly: false,
|
|
34
|
+
write: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'pitcher_groups_add_user',
|
|
38
|
+
title: 'Add a user to a group',
|
|
39
|
+
description: 'Add a user to a content-distribution group. Rejected on auto-login-managed groups.',
|
|
40
|
+
inputShape: {
|
|
41
|
+
groupId: z.string().describe('Group ID (required)'),
|
|
42
|
+
userId: z.string().describe('User ID (integer, required)'),
|
|
43
|
+
},
|
|
44
|
+
run: runGroupsAddUser,
|
|
45
|
+
readOnly: false,
|
|
46
|
+
write: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'pitcher_groups_list_users',
|
|
50
|
+
title: "List a group's members",
|
|
51
|
+
description: "List a content-distribution group's members.",
|
|
52
|
+
inputShape: {
|
|
53
|
+
groupId: z.string().describe('Group whose members to list (required)'),
|
|
54
|
+
page: z.number().int().optional().describe('Page number'),
|
|
55
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
56
|
+
},
|
|
57
|
+
run: runGroupsListUsers,
|
|
58
|
+
readOnly: true,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runInstancesList, runInstancesInfo } from '../../commands/instances.js';
|
|
3
|
+
export const instancesTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_instances_list',
|
|
6
|
+
title: 'List instances',
|
|
7
|
+
description: 'Discover Pitcher instances in the org. Use to resolve instance names to instance IDs.' +
|
|
8
|
+
' Output may include raw instance settings/metadata (potentially integration credentials) - treat as sensitive.',
|
|
9
|
+
inputShape: {
|
|
10
|
+
region: z.string().optional().describe('Filter by region'),
|
|
11
|
+
storageRegion: z.string().optional().describe('Filter by storage region'),
|
|
12
|
+
environment: z.string().optional().describe('Filter by environment'),
|
|
13
|
+
page: z.number().int().optional(),
|
|
14
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
15
|
+
},
|
|
16
|
+
run: runInstancesList,
|
|
17
|
+
readOnly: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'pitcher_instances_info',
|
|
21
|
+
title: 'Get an instance',
|
|
22
|
+
description: 'Retrieve details for a single instance by its ID.' +
|
|
23
|
+
' Output may include raw instance settings/metadata (potentially integration credentials) - treat as sensitive.',
|
|
24
|
+
inputShape: { id: z.string().describe('Instance ID') },
|
|
25
|
+
run: runInstancesInfo,
|
|
26
|
+
readOnly: true,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runInvitationsList, runInvitationsGet } from '../../commands/invitations.js';
|
|
3
|
+
export const invitationsTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_invitations_list',
|
|
6
|
+
title: 'List invitations',
|
|
7
|
+
description: 'List pending user invitations in the org.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
page: z.number().int().optional().describe('Page number'),
|
|
10
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
11
|
+
},
|
|
12
|
+
run: runInvitationsList,
|
|
13
|
+
readOnly: true,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'pitcher_invitations_get',
|
|
17
|
+
title: 'Get an invitation',
|
|
18
|
+
description: 'Retrieve a single pending invitation by ID.',
|
|
19
|
+
inputShape: { id: z.string().describe('Invitation ID') },
|
|
20
|
+
run: runInvitationsGet,
|
|
21
|
+
readOnly: true,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runMembershipsList, runMembershipsAdd, runMembershipsSetRole } from '../../commands/memberships.js';
|
|
3
|
+
export const membershipsTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_memberships_list',
|
|
6
|
+
title: 'List instance memberships',
|
|
7
|
+
description: 'List instance memberships. Filter by instance or user to discover membership IDs before set-role.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().optional().describe('Filter by instance'),
|
|
10
|
+
userId: z.string().optional().describe('Filter by user (integer id)'),
|
|
11
|
+
page: z.number().int().optional().describe('Page number'),
|
|
12
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
13
|
+
},
|
|
14
|
+
run: runMembershipsList,
|
|
15
|
+
readOnly: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'pitcher_memberships_add',
|
|
19
|
+
title: 'Add a member',
|
|
20
|
+
description: "Add a user to an instance as 'member' (role is always 'member' — this endpoint never accepts a " +
|
|
21
|
+
"caller-supplied role). Use pitcher_memberships_set_role to change the role afterward.",
|
|
22
|
+
inputShape: {
|
|
23
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
24
|
+
userId: z.string().describe('User ID (integer, required)'),
|
|
25
|
+
},
|
|
26
|
+
run: runMembershipsAdd,
|
|
27
|
+
readOnly: false,
|
|
28
|
+
write: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'pitcher_memberships_set_role',
|
|
32
|
+
title: 'Set a membership role',
|
|
33
|
+
description: "Change a membership's role via the validating next-core endpoint. Requires an org-admin key. " +
|
|
34
|
+
"--role is the SHORT role name (e.g. 'editor') from pitcher_roles_list, not a prefixed key.",
|
|
35
|
+
inputShape: {
|
|
36
|
+
membershipId: z.string().describe('Membership row ID (integer, required)'),
|
|
37
|
+
role: z.string().describe('Short role name, e.g. editor (required)'),
|
|
38
|
+
scope: z
|
|
39
|
+
.enum(['instance', 'organization'])
|
|
40
|
+
.optional()
|
|
41
|
+
.describe('Scope of the role assignment (default instance)'),
|
|
42
|
+
},
|
|
43
|
+
run: runMembershipsSetRole,
|
|
44
|
+
readOnly: false,
|
|
45
|
+
write: true,
|
|
46
|
+
},
|
|
47
|
+
];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runMetadataTemplateList, runMetadataTemplateGet, runMetadataTemplateUpsert, } from '../../commands/metadataTemplate.js';
|
|
3
|
+
export const metadataTemplateTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_metadata_template_list',
|
|
6
|
+
title: 'List metadata templates',
|
|
7
|
+
description: "List an instance's metadata-field schema(s) (metadata templates).",
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
page: z.number().int().optional().describe('Page number'),
|
|
11
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
12
|
+
},
|
|
13
|
+
run: runMetadataTemplateList,
|
|
14
|
+
readOnly: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'pitcher_metadata_template_get',
|
|
18
|
+
title: 'Get a metadata template',
|
|
19
|
+
description: 'Retrieve a single metadata template by its ID (ULID).',
|
|
20
|
+
inputShape: { id: z.string().describe('Metadata template ID (ULID)') },
|
|
21
|
+
run: runMetadataTemplateGet,
|
|
22
|
+
readOnly: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'pitcher_metadata_template_upsert',
|
|
26
|
+
title: 'Upsert a metadata template',
|
|
27
|
+
description: "Upsert an instance's metadata-field schema. Merges the incoming sections by section 'label' — a " +
|
|
28
|
+
'section whose label matches an existing one is replaced, other sections are preserved. Cannot remove ' +
|
|
29
|
+
'a section or field. Pass exactly one of sections or sectionsFile. Requires an instance- or org-admin key.',
|
|
30
|
+
inputShape: {
|
|
31
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
32
|
+
sections: z.string().optional().describe('Sections JSON array (inline)'),
|
|
33
|
+
sectionsFile: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Path to a JSON file (on the MCP server host) with the sections array'),
|
|
37
|
+
},
|
|
38
|
+
run: runMetadataTemplateUpsert,
|
|
39
|
+
readOnly: false,
|
|
40
|
+
write: true,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { runOrgGet } from '../../commands/org.js';
|
|
2
|
+
export const orgTools = [
|
|
3
|
+
{
|
|
4
|
+
name: 'pitcher_org_get',
|
|
5
|
+
title: 'Get the organization',
|
|
6
|
+
description: 'Retrieve the organization the API key belongs to. Response may include raw settings/metadata ' +
|
|
7
|
+
'(potentially integration credentials) — treat output as sensitive.',
|
|
8
|
+
inputShape: {},
|
|
9
|
+
run: runOrgGet,
|
|
10
|
+
readOnly: true,
|
|
11
|
+
},
|
|
12
|
+
];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runPublishApp } from '../../commands/publishApp.js';
|
|
3
|
+
// Narrow individual injected/validated values (the MCP zod schema already guarantees the runtime
|
|
4
|
+
// type) instead of casting the whole opts blob — same approach as the devSync wrappers.
|
|
5
|
+
const asString = (v) => (typeof v === 'string' ? v : undefined);
|
|
6
|
+
const asBool = (v) => (typeof v === 'boolean' ? v : undefined);
|
|
7
|
+
export const publishAppTools = [
|
|
8
|
+
{
|
|
9
|
+
name: 'pitcher_publish_app',
|
|
10
|
+
title: 'Publish an app release',
|
|
11
|
+
description: 'Zip a local app folder (on the MCP server host) and publish it as a new app release to the org, ' +
|
|
12
|
+
'optionally installing it to specific instances or all instances of an environment afterward. ' +
|
|
13
|
+
'Consequential: this creates a live, org-visible app release — use dryRun to preview first. ' +
|
|
14
|
+
'Re-publishing an already-existing version is a no-op (returns ok with a warning), not a failure. ' +
|
|
15
|
+
'Publish targets the org resolved from NG_ORG; the injected NG_URL is not used as the publish endpoint.',
|
|
16
|
+
inputShape: {
|
|
17
|
+
folder: z.string().optional().describe('Local folder to zip and publish (defaults to the MCP server cwd)'),
|
|
18
|
+
incrementVersion: z.boolean().optional().describe('Bump the version in app.json before publishing'),
|
|
19
|
+
dryRun: z.boolean().optional().describe('Preview the publish (version, target) without publishing anything'),
|
|
20
|
+
installTo: z.string().optional().describe('Comma-separated instance IDs to install the app to after publishing'),
|
|
21
|
+
installToEnvName: z.string().optional().describe('Environment name (e.g. "test") to install the app to after publishing'),
|
|
22
|
+
},
|
|
23
|
+
// runPublishApp overloads `url` as BOTH origin and publish endpoint; the server injects NG_URL into
|
|
24
|
+
// every tool, so forward only apiKey + org (never url) plus this tool's own inputs.
|
|
25
|
+
run: (opts) => runPublishApp({
|
|
26
|
+
folder: asString(opts.folder),
|
|
27
|
+
incrementVersion: asBool(opts.incrementVersion),
|
|
28
|
+
dryRun: asBool(opts.dryRun),
|
|
29
|
+
installTo: asString(opts.installTo),
|
|
30
|
+
installToEnvName: asString(opts.installToEnvName),
|
|
31
|
+
apiKey: opts.apiKey,
|
|
32
|
+
org: opts.org,
|
|
33
|
+
}),
|
|
34
|
+
wraps: runPublishApp,
|
|
35
|
+
readOnly: false,
|
|
36
|
+
write: true,
|
|
37
|
+
alwaysDestructive: true,
|
|
38
|
+
},
|
|
39
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runRolesList } from '../../commands/roles.js';
|
|
3
|
+
export const rolesTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_roles_list',
|
|
6
|
+
title: 'List roles',
|
|
7
|
+
description: 'List the org role set (system + custom roles) — use to discover valid short role names ' +
|
|
8
|
+
'before setting a membership role. Needs an org-admin key.',
|
|
9
|
+
inputShape: {
|
|
10
|
+
scope: z.enum(['instance', 'organization']).optional().describe('Filter by scope'),
|
|
11
|
+
},
|
|
12
|
+
run: runRolesList,
|
|
13
|
+
readOnly: true,
|
|
14
|
+
},
|
|
15
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runSearch } from '../../commands/search.js';
|
|
3
|
+
export const searchTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_search',
|
|
6
|
+
title: 'Search content',
|
|
7
|
+
description: 'Cross-type ranked search across an instance (files, canvases, users, apps). Use to find content by keyword when the ID is unknown.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
query: z.string().describe('Search query (required)'),
|
|
11
|
+
includeExpired: z.boolean().optional().describe('Include expired content'),
|
|
12
|
+
},
|
|
13
|
+
run: runSearch,
|
|
14
|
+
readOnly: true,
|
|
15
|
+
},
|
|
16
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runSharedLinksCreate, runSharedLinksGet } from '../../commands/sharedLinks.js';
|
|
3
|
+
export const sharedLinksTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_shared_links_create',
|
|
6
|
+
title: 'Create a shared link',
|
|
7
|
+
description: 'Create a share link (short_url) for a canvas or a file. Pass exactly one of canvasId or fileId. Additive.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
canvasId: z.string().optional().describe('Canvas to share (exactly one of canvasId/fileId is required)'),
|
|
10
|
+
fileId: z.string().optional().describe('File to share (exactly one of canvasId/fileId is required)'),
|
|
11
|
+
},
|
|
12
|
+
run: runSharedLinksCreate,
|
|
13
|
+
readOnly: false,
|
|
14
|
+
write: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'pitcher_shared_links_get',
|
|
18
|
+
title: 'Get a shared link',
|
|
19
|
+
description: 'Retrieve the existing share link for a canvas or a file. Pass exactly one of canvasId or fileId.',
|
|
20
|
+
inputShape: {
|
|
21
|
+
canvasId: z.string().optional().describe('Canvas whose link to fetch (exactly one of canvasId/fileId is required)'),
|
|
22
|
+
fileId: z.string().optional().describe('File whose link to fetch (exactly one of canvasId/fileId is required)'),
|
|
23
|
+
},
|
|
24
|
+
run: runSharedLinksGet,
|
|
25
|
+
readOnly: true,
|
|
26
|
+
},
|
|
27
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runTagsList } from '../../commands/tags.js';
|
|
3
|
+
export const tagsTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_tags_list',
|
|
6
|
+
title: 'List tags',
|
|
7
|
+
description: 'List tags in an instance matching a search term (at least 3 characters). Use to discover tag values before filtering files/canvases.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
search: z.string().min(3).describe('Search term (required, at least 3 characters)'),
|
|
11
|
+
type: z.enum(['files', 'canvases']).optional(),
|
|
12
|
+
canvasType: z.string().optional().describe('Canvas type filter'),
|
|
13
|
+
includeHidden: z.boolean().optional().describe('Include hidden tags'),
|
|
14
|
+
page: z.number().int().optional(),
|
|
15
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
16
|
+
},
|
|
17
|
+
run: runTagsList,
|
|
18
|
+
readOnly: true,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runThemesList, runThemesGet } from '../../commands/themes.js';
|
|
3
|
+
export const themesTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_themes_list',
|
|
6
|
+
title: 'List themes',
|
|
7
|
+
description: 'List canvas/branding themes (colors, fonts, assets) in the org. Omit instanceId to see all ' +
|
|
8
|
+
'org-level and instance themes; set it to narrow to themes bound to that instance.',
|
|
9
|
+
inputShape: {
|
|
10
|
+
instanceId: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe('Filter to themes bound to this instance (excludes org-level themes)'),
|
|
14
|
+
withUsage: z.boolean().optional().describe('Include a per-theme count of canvases using it'),
|
|
15
|
+
withCanvasIds: z.boolean().optional().describe('Include the canvas ids using each theme'),
|
|
16
|
+
},
|
|
17
|
+
run: runThemesList,
|
|
18
|
+
readOnly: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'pitcher_themes_get',
|
|
22
|
+
title: 'Get a theme',
|
|
23
|
+
description: 'Retrieve a single theme by its ID.',
|
|
24
|
+
inputShape: { id: z.string().describe('Theme ID') },
|
|
25
|
+
run: runThemesGet,
|
|
26
|
+
readOnly: true,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { Envelope } from '../../core/envelope.js';
|
|
3
|
+
import type { CommonOpts } from '../../core/http.js';
|
|
4
|
+
export type InjectedAuth = Pick<CommonOpts, 'apiKey' | 'org' | 'url'>;
|
|
5
|
+
export interface ToolDescriptor {
|
|
6
|
+
name: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
inputShape: z.ZodRawShape;
|
|
10
|
+
run: (opts: Record<string, unknown> & InjectedAuth, deps?: any) => Promise<Envelope<unknown>>;
|
|
11
|
+
wraps?: (...a: any[]) => unknown;
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
write?: boolean;
|
|
14
|
+
alwaysDestructive?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runUsersList, runUsersGet } from '../../commands/users.js';
|
|
3
|
+
export const usersTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_users_list',
|
|
6
|
+
title: 'List users',
|
|
7
|
+
description: 'List users in the org. Use filters to narrow by instance membership, role, or active status.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().optional().describe('Filter to users with a membership in this instance'),
|
|
10
|
+
instanceRole: z.string().optional().describe('Filter by instance role (requires instanceId server-side)'),
|
|
11
|
+
role: z.string().optional().describe('Filter by org role'),
|
|
12
|
+
isActive: z
|
|
13
|
+
.literal(true)
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Filter to active users only (only true is meaningful; false is a no-op)'),
|
|
16
|
+
cdg: z.string().optional().describe('Filter to members of this content-distribution group'),
|
|
17
|
+
page: z.number().int().optional().describe('Page number'),
|
|
18
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
19
|
+
},
|
|
20
|
+
run: runUsersList,
|
|
21
|
+
readOnly: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'pitcher_users_get',
|
|
25
|
+
title: 'Get a user',
|
|
26
|
+
description: 'Retrieve a single user by ID.',
|
|
27
|
+
inputShape: { id: z.string().describe('User ID (integer)') },
|
|
28
|
+
run: runUsersGet,
|
|
29
|
+
readOnly: true,
|
|
30
|
+
},
|
|
31
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pitcher/cli-scripts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "The Pitcher CLI for various tasks in its ecosystem.",
|
|
5
5
|
"author": "Pitcher AG",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,10 +31,12 @@
|
|
|
31
31
|
"vitest": "^4.1.9"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
+
"@modelcontextprotocol/sdk": "^1",
|
|
34
35
|
"archiver": "^7.0.1",
|
|
35
36
|
"axios": "^1.18.1",
|
|
36
37
|
"chokidar": "^5.0.0",
|
|
37
38
|
"commander": "^14.0.3",
|
|
38
|
-
"form-data": "^4.0.6"
|
|
39
|
+
"form-data": "^4.0.6",
|
|
40
|
+
"zod": "^3"
|
|
39
41
|
}
|
|
40
42
|
}
|