@softspark/confluence-mcp 1.12.0 → 1.13.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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
- import { ConfluenceSpaceInstanceConfig, AdfDocument, ConfluenceConfig, ToolResult, ToolDefinition } from '@softspark/atlassian-mcp-core';
2
+ import { ConfluenceSpaceInstanceConfig, AdfDocument, ConfluenceConfig, BodyFormat as BodyFormat$1, TemplateVariable, ToolResult, ToolDefinition } from '@softspark/atlassian-mcp-core';
3
3
 
4
4
  /**
5
5
  * Project-owned Confluence types.
@@ -482,6 +482,65 @@ declare class ConfluenceInstancePool {
482
482
  getSpaceKeys(): readonly string[];
483
483
  }
484
484
 
485
+ /**
486
+ * Page template types.
487
+ *
488
+ * A page template carries a title and a body, both rendered with the shared
489
+ * `{{variable}}` engine. The body is markdown or Confluence storage XHTML,
490
+ * declared by `format`, because a template written in one is unusable in a
491
+ * space configured for the other.
492
+ *
493
+ * @module
494
+ */
495
+
496
+ /** Where a template came from, for reporting in tool results. */
497
+ type PageTemplateSource = 'system' | 'user';
498
+ interface PageTemplate {
499
+ readonly id: string;
500
+ readonly name: string;
501
+ readonly description: string;
502
+ /** Body representation this template is written in. */
503
+ readonly format: BodyFormat$1;
504
+ readonly variables: readonly TemplateVariable[];
505
+ /** Page title, itself a template so it can carry variables. */
506
+ readonly title: string;
507
+ /** Page body in the declared format. */
508
+ readonly body: string;
509
+ readonly labels?: readonly string[];
510
+ readonly source?: PageTemplateSource;
511
+ readonly filePath?: string;
512
+ }
513
+ /** Result of rendering a page template into a ready-to-create page. */
514
+ interface RenderedPage {
515
+ readonly title: string;
516
+ readonly body: string;
517
+ readonly format: BodyFormat$1;
518
+ readonly labels: readonly string[];
519
+ }
520
+
521
+ declare class PageTemplateRegistry {
522
+ private readonly byId;
523
+ constructor(templates: readonly PageTemplate[]);
524
+ /**
525
+ * Build a registry from the shipped and user template directories.
526
+ *
527
+ * User templates are loaded second so an id present in both resolves to the
528
+ * user's copy.
529
+ */
530
+ static load(systemDir: string, userDir: string): PageTemplateRegistry;
531
+ listTemplates(format?: BodyFormat$1): readonly PageTemplate[];
532
+ /** @throws {TemplateNotFoundError} If no template carries that id. */
533
+ getTemplate(id: string): PageTemplate;
534
+ /**
535
+ * Render a template's title and body with the supplied variables.
536
+ *
537
+ * Both go through the same engine, so a variable can appear in either.
538
+ *
539
+ * @throws {Error} If a required variable is missing, naming the ones needed.
540
+ */
541
+ render(id: string, variables: Readonly<Record<string, string>>): RenderedPage;
542
+ }
543
+
485
544
  /**
486
545
  * Shared utilities for Confluence MCP tool handlers.
487
546
  *
@@ -495,6 +554,8 @@ declare class ConfluenceInstancePool {
495
554
  interface ConfluenceDeps {
496
555
  readonly pool: ConfluenceInstancePool;
497
556
  readonly config: ConfluenceConfig;
557
+ /** Page templates, loaded once at startup. */
558
+ readonly pageTemplates?: PageTemplateRegistry;
498
559
  }
499
560
 
500
561
  /**