@pitcher/cli-scripts 2.10.0 → 2.11.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/dist/index.js CHANGED
File without changes
@@ -0,0 +1,2 @@
1
+ import type { PromptDescriptor } from './types.js';
2
+ export declare const announcementsPrompts: PromptDescriptor[];
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ import { instanceLine, recipePreamble } from './shared.js';
3
+ export const announcementsPrompts = [
4
+ {
5
+ name: 'seed_announcement',
6
+ title: 'Create announcement',
7
+ description: 'Author an on-brand in-app announcement (title + body HTML + CTA) and create it in an instance.',
8
+ argsSchema: {
9
+ instance_id: z.string().optional().describe('Target instance ID (leave blank to resolve interactively)'),
10
+ vertical: z.string().optional().describe('pharma | medtech | cpg | finserv | generic'),
11
+ use_case: z.string().optional().describe('Short description of what this announcement is about'),
12
+ },
13
+ build: (args) => {
14
+ const vertical = args.vertical || 'generic';
15
+ const useCase = args.use_case || 'a general product / process announcement a rep would see in-app';
16
+ const text = [
17
+ recipePreamble(),
18
+ '',
19
+ '## Task: seed an announcement',
20
+ instanceLine(args.instance_id),
21
+ `Vertical: ${vertical}. Use case: ${useCase}.`,
22
+ '',
23
+ 'Steps:',
24
+ '1. Draft a short, on-brand announcement: a concise title and a **body in inline-CSS HTML** ' +
25
+ 'following the principles above — a few sentences, one clear call-to-action, brand-derived colors, ' +
26
+ 'and any dynamic values via escaped `{{token}}` merge fields.',
27
+ '2. Create it by calling `pitcher_announcements_create` with `{ instanceId, title, body }` — ' +
28
+ 'pass the HTML **inline via `body`** (a file path cannot cross a host\'s sandbox boundary, so always inline). ' +
29
+ 'Add `priority` only if the user asks for an important announcement.',
30
+ '3. Report the created announcement id and title.',
31
+ ].join('\n');
32
+ return [{ role: 'user', content: { type: 'text', text } }];
33
+ },
34
+ },
35
+ ];
@@ -0,0 +1,2 @@
1
+ import type { PromptDescriptor } from './types.js';
2
+ export declare const dsrPrompts: PromptDescriptor[];
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+ import { instanceLine, safetyPreamble } from './shared.js';
3
+ export const dsrPrompts = [
4
+ {
5
+ name: 'seed_dsr',
6
+ title: 'Create and share a DSR',
7
+ description: 'Share a canvas (or files) as a Digital Sales Room with the right gating, optionally branded with a landing page.',
8
+ argsSchema: {
9
+ instance_id: z.string().optional().describe('Target instance ID (leave blank to resolve interactively)'),
10
+ canvas_id: z.string().optional().describe('Canvas to share (leave blank to pick one interactively)'),
11
+ audience: z.string().optional().describe('Who the DSR is for, e.g. "internal", "a known contact", "an account/domain"'),
12
+ },
13
+ build: (args) => {
14
+ const audience = args.audience || 'the intended external recipient';
15
+ const text = [
16
+ // NOTE: this is a share WORKFLOW recipe, not an HTML-authoring one — it does NOT author a
17
+ // landing page (that is the separate `seed_dsr_landing` recipe). It only BINDS an existing
18
+ // template. So it embeds only the safety guidance, not the HTML design principles.
19
+ safetyPreamble(),
20
+ '',
21
+ '## DSR sharing guidance',
22
+ '- **Source is exactly one of** a canvas (`canvasId`) OR files (`shareboxFileIds`).',
23
+ `- **Pick the gating (\`authStrategy\`) by audience.** For ${audience}: internal/quick demo → \`none\` ` +
24
+ '(open link); a known individual → `specified_emails` (+ `allowedEmails`); a company → ' +
25
+ '`specified_domains` (+ `allowedDomains`); the server default is `any_email`. Add `validUntil` ' +
26
+ '(ISO datetime) to time-box a customer-facing link; set `allowForward`/`allowDownload` deliberately.',
27
+ '- **Branding the pre-auth page is a SEPARATE step:** this recipe only **binds** an existing ' +
28
+ 'landing template (`landingTemplateId`, discover via `pitcher_dsr_landing_list`; pass ' +
29
+ '`landingContext` merge fields **as a JSON object serialized to a string**, not as an object). ' +
30
+ 'If no suitable template exists and the user wants a ' +
31
+ 'branded landing, author one FIRST with the **`seed_dsr_landing`** recipe, then bind its id here. ' +
32
+ 'Do NOT hand-write landing HTML in this recipe.',
33
+ '',
34
+ '## Task: create and share a DSR',
35
+ instanceLine(args.instance_id),
36
+ args.canvas_id ? `Canvas to share: ${args.canvas_id}.` : 'No canvas given — help the user pick one via `pitcher_canvases_list`.',
37
+ `Audience: ${audience}.`,
38
+ '',
39
+ 'Steps:',
40
+ '1. Resolve the source (the given `canvas_id`, or pick a canvas with the user via `pitcher_canvases_list`).',
41
+ '2. Choose the gating strategy with the user per the guidance above; set expiry/forward/download as appropriate.',
42
+ '3. (Optional) To brand the pre-auth page, list templates with `pitcher_dsr_landing_list` and bind one via ' +
43
+ '`landingTemplateId` — or point the user at `seed_dsr_landing` to author a new one first.',
44
+ '4. Call `pitcher_dsr_create` with the resolved fields. A denied/failed landing bind returns the link with a ' +
45
+ 'warning (not a failure) — surface it. Report the returned `short_url`.',
46
+ ].join('\n');
47
+ return [{ role: 'user', content: { type: 'text', text } }];
48
+ },
49
+ },
50
+ ];
@@ -1,4 +1,6 @@
1
1
  import { emailTemplatePrompts } from './emailTemplate.js';
2
2
  import { dsrLandingPrompts } from './dsrLanding.js';
3
+ import { dsrPrompts } from './dsr.js';
4
+ import { announcementsPrompts } from './announcements.js';
3
5
  // Every recipe prompt the server can expose. Mirrors mcp/registry.ts (allTools).
4
- export const allPrompts = [...emailTemplatePrompts, ...dsrLandingPrompts];
6
+ export const allPrompts = [...emailTemplatePrompts, ...dsrLandingPrompts, ...dsrPrompts, ...announcementsPrompts];
@@ -1,2 +1,3 @@
1
1
  export declare function instanceLine(instanceId: string | undefined): string;
2
+ export declare function safetyPreamble(): string;
2
3
  export declare function recipePreamble(): string;
@@ -6,16 +6,16 @@ export function instanceLine(instanceId) {
6
6
  ? `Target instance: ${instanceId}.`
7
7
  : 'No instance was given — call `pitcher_instances_list`, pick the right one with the user, and confirm before creating.';
8
8
  }
9
- // Shared preamble embedded at the top of every recipe prompt. Authored once so the
10
- // design principles, prod-awareness, and anti-XSS guidance can't drift between prompts.
11
- export function recipePreamble() {
9
+ // Prod-awareness + anti-XSS guidance shared by EVERY recipe prompt (HTML-authoring or not).
10
+ // Split out of recipePreamble so non-authoring workflow recipes (e.g. seed_dsr) can carry the
11
+ // safety guidance without the HTML design principles. Contains the strings every prompt is
12
+ // required to include: "demo/test instance", "{{token}}", "{{{ }}}".
13
+ export function safetyPreamble() {
12
14
  return [
13
- CONTENT_DESIGN_PRINCIPLES,
14
- '',
15
15
  '## Before you create',
16
16
  'Confirm the resolved instance is a demo/test instance. These tools create **live, ' +
17
- 'org-visible** content; a DSR landing page is served to **external, unauthenticated** ' +
18
- 'viewers. Do not seed against a real customer instance without explicit confirmation from the user.',
17
+ 'org-visible** content; a DSR is served to **external, unauthenticated** viewers. Do not ' +
18
+ 'seed against a real customer instance without explicit confirmation from the user.',
19
19
  '',
20
20
  '## Safe content',
21
21
  'Put dynamic values through the platform `{{token}}` merge fields (the platform escapes them). ' +
@@ -24,3 +24,8 @@ export function recipePreamble() {
24
24
  'the generated markup.',
25
25
  ].join('\n');
26
26
  }
27
+ // Full preamble for HTML-authoring recipes: the design principles + the safety guidance.
28
+ // Authored once so the principles, prod-awareness, and anti-XSS guidance can't drift.
29
+ export function recipePreamble() {
30
+ return [CONTENT_DESIGN_PRINCIPLES, '', safetyPreamble()].join('\n');
31
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pitcher/cli-scripts",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "The Pitcher CLI for various tasks in its ecosystem.",
5
5
  "author": "Pitcher AG",
6
6
  "license": "MIT",