@cplace/mcp-server 2.2.0 → 2.2.1

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.
Files changed (34) hide show
  1. package/dist/api.d.ts.map +1 -1
  2. package/dist/api.js +0 -1
  3. package/dist/api.js.map +1 -1
  4. package/dist/capability-gating.d.ts +4 -0
  5. package/dist/capability-gating.d.ts.map +1 -1
  6. package/dist/capability-gating.js +28 -9
  7. package/dist/capability-gating.js.map +1 -1
  8. package/dist/index.js +8 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/local-mode.d.ts +3 -0
  11. package/dist/local-mode.d.ts.map +1 -0
  12. package/dist/local-mode.js +8 -0
  13. package/dist/local-mode.js.map +1 -0
  14. package/dist/logger.d.ts +1 -0
  15. package/dist/logger.d.ts.map +1 -1
  16. package/dist/logger.js +5 -1
  17. package/dist/logger.js.map +1 -1
  18. package/dist/plugins/core/app-catalog/README.md +4 -1
  19. package/dist/plugins/core/app-catalog/cf.cplace.lowCodeWidgetBuilder/README.md +117 -0
  20. package/dist/plugins/core/app-catalog/cf.cplace.lowCodeWidgetRenderer/README.md +37 -0
  21. package/dist/plugins/core/app-catalog/cf.cplace.lowcode.ai/README.md +62 -9
  22. package/dist/plugins/core/widget-specifications/cf.cplace.workflow.widget/_meta.json +1 -1
  23. package/dist/plugins/resource-management/app-catalog/cf.cplace.resourceManagement/README.md +42 -30
  24. package/dist/plugins/resource-management/app-catalog/cf.cplace.resourceManagement.predefinedValueTypes/README.md +67 -0
  25. package/dist/tools/documents.d.ts.map +1 -1
  26. package/dist/tools/documents.js +77 -14
  27. package/dist/tools/documents.js.map +1 -1
  28. package/dist/tools/system.js +2 -2
  29. package/dist/tools/system.js.map +1 -1
  30. package/dist/utils/fileIO.d.ts +3 -0
  31. package/dist/utils/fileIO.d.ts.map +1 -1
  32. package/dist/utils/fileIO.js +14 -0
  33. package/dist/utils/fileIO.js.map +1 -1
  34. package/package.json +2 -2
@@ -14,22 +14,73 @@ widgets build on.
14
14
 
15
15
  ## Dependencies
16
16
 
17
- - `cf.cplace.platform` (cplace Basis) — always pre-installed
17
+ When this app is installed, the following apps are automatically installed:
18
18
 
19
- > Dependencies were not confirmed via a live workspace investigation; only the always-present platform base is listed.
19
+ | App | Qualified Name | Description |
20
+ |-----|----------------|-------------|
21
+ | Attribute Dependencies | `cf.cplace.attributeDependencies` | Required in the same workspace; hides tool-parameter fields by parameter type (`AiApp.getRequiredAppsInSameSpace`) |
22
+ | cplace Basis | `cf.cplace.platform` | Base platform (always installed) |
20
23
 
21
24
  ## Types Provided
22
25
 
23
- Not observed. This README was authored from existing in-repo widget specifications without a live-workspace
24
- investigation, so no type definitions were confirmed for this app. Citizen AI is used primarily through the widgets
25
- listed below. Run the standard investigation (see `INVESTIGATION-PROMPT.md`) to populate types if needed.
26
+ ### cf.cplace.lowcode.ai.assistantConfiguration (Citizen AI Assistant Configuration)
27
+
28
+ Configures one AI assistant: its instructions, model, tools and knowledge sources. The type keeps the
29
+ pre-rename prefix `cf.cplace.lowcode.ai`; attributes added later use `cf.cplace.citizenAi`.
30
+
31
+ | Attribute | Internal Name | Type | Required | Description |
32
+ |-----------|---------------|------|----------|-------------|
33
+ | Instructions | `cf.cplace.lowcode.ai.systemMessage` | Script (Markdown) | Yes | System message given to the model |
34
+ | Model | `cf.cplace.lowcode.ai.modelId` | Text (dynamic enumeration) | Yes | One of the chat models configured for the tenant |
35
+ | Temperature | `cf.cplace.lowcode.ai.temperature` | Number | Yes | Sampling temperature, with a default value |
36
+ | Seed | `cf.cplace.lowcode.ai.seed` | Number | No | Seed for reproducible answers |
37
+ | Max. Tokens | `cf.cplace.lowcode.ai.maxTokens` | Number | No | Upper bound for the answer length |
38
+ | Custom Tools | `cf.cplace.citizenAi.tools` | Reference (multiple, to Tool) | No | No-code tools the assistant may call |
39
+ | Platform Tools | `cf.cplace.citizenAi.platformTools` | Text (dynamic enumeration, multiple) | No | Built-in platform tools the assistant may call |
40
+ | Available in AI Companion | `cf.cplace.citizenAi.availableInAiCompanion` | Boolean | No | Offer the assistant in the AI Companion (default false) |
41
+ | Default in AI Companion | `cf.cplace.citizenAi.defaultInAiCompanion` | Boolean | No | Preselect the assistant in the AI Companion (default false) |
42
+ | Icon | `cf.cplace.citizenAi.companionIcon` | Icon | No | Icon shown in the AI Companion |
43
+ | Contextual Knowledge Sources | `cf.cplace.citizenAi.ragDataSources` | Text (dynamic enumeration, multiple) | No | Knowledge sources searched for context |
44
+
45
+ **Icon:** `fa-robot`
46
+
47
+ ---
48
+
49
+ ### cf.cplace.citizenAi.noCodeTool (Tool)
50
+
51
+ A scripted tool an assistant can call. Only users with Low-Code permission may create one or edit its script.
52
+
53
+ | Attribute | Internal Name | Type | Required | Description |
54
+ |-----------|---------------|------|----------|-------------|
55
+ | Tool Name | `cf.cplace.citizenAi.name` | Text | Yes | Name the model calls the tool by (`[a-zA-Z0-9-_]+`) |
56
+ | Description | `cf.cplace.citizenAi.description` | Long text | No | What the tool does, read by the model |
57
+ | Parameters | `cf.cplace.citizenAi.parameters` | Reference (multiple, to Tool Parameter) | No | The tool's parameters |
58
+ | Script | `cf.cplace.citizenAi.script` | Script | Yes | cplaceJS executed when the tool is called |
59
+
60
+ **Icon:** `fa-tools`
61
+
62
+ ---
63
+
64
+ ### cf.cplace.citizenAi.toolParameter (Tool Parameter)
65
+
66
+ One parameter of a Tool.
67
+
68
+ | Attribute | Internal Name | Type | Required | Description |
69
+ |-----------|---------------|------|----------|-------------|
70
+ | Parameter Name | `cf.cplace.citizenAi.name` | Text | Yes | Name of the parameter (`[a-zA-Z0-9-_]+`) |
71
+ | Description | `cf.cplace.citizenAi.description` | Long text | No | What the parameter means, read by the model |
72
+ | Type | `cf.cplace.citizenAi.type` | Enumeration | Yes | Parameter type |
73
+ | Required | `cf.cplace.citizenAi.required` | Boolean | No | Whether the model must pass it (default true) |
74
+ | Allowed Values | `cf.cplace.citizenAi.allowedValues` | Text (multiple) | No | Allowed values; hidden for Boolean parameters |
75
+
76
+ **Icon:** `fa-hashtag`
26
77
 
27
78
  ## Widgets Provided
28
79
 
29
80
  | Widget | Widget Kind | Description | Use Case |
30
81
  |--------|-------------|-------------|----------|
31
82
  | Ask Your Page | `cf.cplace.citizenAi.askYourPageWidget` | Zero-configuration, read-only AI assistant that understands the current page's attributes, relationships, and attached files and answers natural-language questions with links to related pages. Maintains per-user conversation history per page. | Exploring information-rich or highly-connected pages; documentation and knowledge Q&A; relationship navigation. |
32
- | Citizen AI Streaming Chat | *(widget kind not documented)* | The recommended AI chat widget for new use cases; replacement for the deprecated Chat Widget. Detail is not yet documented in this repo (no widget specification available). | New AI chat use cases — use in place of the deprecated Chat Widget. |
83
+ | Citizen AI Streaming Chat | `cf.cplace.citizenAi.streamingChatWidget` | The recommended AI chat widget for new use cases; replacement for the deprecated Chat Widget. Answers with the assistant configuration it is set to. | New AI chat use cases — use in place of the deprecated Chat Widget. |
33
84
  | Chat Widget (deprecated) | `cf.cplace.lowcode.ai.chatWidget` | **Deprecated** — use Citizen AI Streaming Chat instead. A script-based (CplaceJS `checkAccess()` / `call()`) chat interface supporting custom data sources, custom tools, configurable memory, and shared or per-user history. Will be removed in a future version. | Legacy custom AI assistants; new work should use Citizen AI Streaming Chat. |
34
85
 
35
86
  ## Use Cases
@@ -56,8 +107,10 @@ listed below. Run the standard investigation (see `INVESTIGATION-PROMPT.md`) to
56
107
 
57
108
  ## Investigation Details
58
109
 
59
- - **Source:** Authored from in-repo widget specifications
110
+ - **Source:** Widgets from the in-repo widget specifications
60
111
  (`src/plugins/core/widget-specifications/cf.cplace.lowcode.ai.chatWidget/`,
61
112
  `.../cf.cplace.citizenAi.askYourPageWidget/`) and `_catalog-data.json`.
62
- - **Live workspace investigation:** Not run. Types were not observed; the "Citizen AI Streaming Chat" widget has no
63
- widget specification in the repo yet and is documented by name/role only.
113
+ - **Types and dependencies:** from the `cplace-citizen-ai` source — `AiAppTypes.java` (types, attributes,
114
+ labels from `messages_en.properties`), `AiApp.java` (`getRequiredAppsInSameSpace`), and
115
+ `StreamingChatWidgetDefinition.java` (the Streaming Chat widget kind).
116
+ - **Live workspace investigation:** Not run.
@@ -5,5 +5,5 @@
5
5
  "detail-view",
6
6
  "workflow"
7
7
  ],
8
- "requiredApp": "cf.cplace.workflow"
8
+ "requiredApp": null
9
9
  }
@@ -21,51 +21,56 @@ The Resource Management app enables configuration and planning of resources acro
21
21
 
22
22
  ## Types Provided
23
23
 
24
- ### cf.cplace.resourceManagement.resourceTypeConfiguration
24
+ The attribute internal names carry the prefix `cf.cplace.resourceManagement.`; labels are the English ones
25
+ from `messages_en.properties`.
26
+
27
+ ### cf.cplace.resourceManagement.resourceTypeConfiguration (Resource Type Configuration)
25
28
 
26
29
  Configures which types in the workspace should be treated as **resources** (e.g., Person, Team, Machine).
27
30
 
28
- | Attribute | Type | Required | Description |
29
- |-----------|------|----------|-------------|
30
- | `cf.cplace.resourceManagement.type` | Type Reference | Yes | The type to be used as a resource |
31
- | `cf.cplace.resourceManagement.capacityAttribute` | Attribute Reference | No | Attribute defining the capacity of the resource |
32
- | `cf.cplace.resourceManagement.actualAttribute` | Attribute Reference | No | Attribute defining the actual/used value |
33
- | `cf.cplace.resourceManagement.responsibleAttribute` | Attribute Reference | No | Attribute defining responsible person(s) |
34
- | `cf.cplace.resourceManagement.userReferenceAttribute` | Attribute Reference | No | Attribute for displaying user profile picture |
35
- | `cf.cplace.resourceManagement.icon` | Text/Icon | No | Icon displayed in Resource Planner widget |
31
+ | Attribute | Internal Name | Type | Required | Description |
32
+ |-----------|---------------|------|----------|-------------|
33
+ | Resource Type | `cf.cplace.resourceManagement.type` | Text (type name, dynamic enumeration) | Yes | The type to be used as a resource |
34
+ | Capacity Attribute | `cf.cplace.resourceManagement.capacityAttribute` | Text (attribute name, dynamic enumeration) | No | Attribute defining the capacity of the resource |
35
+ | Actual Attribute | `cf.cplace.resourceManagement.actualAttribute` | Text (attribute name, dynamic enumeration) | No | Attribute defining the actual/used value |
36
+ | Responsible Attribute | `cf.cplace.resourceManagement.responsibleAttribute` | Text (attribute name, dynamic enumeration) | No | Attribute defining responsible person(s) |
37
+ | User Reference Attribute | `cf.cplace.resourceManagement.userReferenceAttribute` | Text (attribute name, dynamic enumeration) | No | Attribute for displaying user profile picture |
38
+ | Icon | `cf.cplace.resourceManagement.icon` | Icon | No | Icon displayed in Resource Planner widget |
36
39
 
37
- ### cf.cplace.resourceManagement.planningItemTypeConfiguration
40
+ ### cf.cplace.resourceManagement.planningItemTypeConfiguration (Planning Item Type Configuration)
38
41
 
39
42
  Configures which types in the workspace should be treated as **planning items** (e.g., Task, Project, Work Package).
40
43
 
41
- | Attribute | Type | Required | Description |
42
- |-----------|------|----------|-------------|
43
- | `cf.cplace.resourceManagement.type` | Type Reference | Yes | The type to be used as a planning item |
44
- | `cf.cplace.resourceManagement.demandAttribute` | Attribute Reference | No | Attribute defining the demand/need |
45
- | `cf.cplace.resourceManagement.actualAttribute` | Attribute Reference | No | Attribute defining the actual value |
46
- | `cf.cplace.resourceManagement.icon` | Text/Icon | No | Icon displayed in Resource Planner widget |
44
+ | Attribute | Internal Name | Type | Required | Description |
45
+ |-----------|---------------|------|----------|-------------|
46
+ | Planning Item Type | `cf.cplace.resourceManagement.type` | Text (type name, dynamic enumeration) | Yes | The type to be used as a planning item |
47
+ | Demand Attribute | `cf.cplace.resourceManagement.demandAttribute` | Text (attribute name, dynamic enumeration) | No | Attribute defining the demand/need |
48
+ | Actual Attribute | `cf.cplace.resourceManagement.actualAttribute` | Text (attribute name, dynamic enumeration) | No | Attribute defining the actual value |
49
+ | Icon | `cf.cplace.resourceManagement.icon` | Icon | No | Icon displayed in Resource Planner widget |
47
50
 
48
- ### cf.cplace.resourceManagement.valueTypeConfiguration
51
+ ### cf.cplace.resourceManagement.valueTypeConfiguration (Value Type Configuration)
49
52
 
50
53
  Configures which types represent **allocation values** that connect resources to planning items.
51
54
 
52
- | Attribute | Type | Required | Description |
53
- |-----------|------|----------|-------------|
54
- | `cf.cplace.resourceManagement.type` | Type Reference | Yes | The type to be used as a value type |
55
- | `cf.cplace.resourceManagement.resourceAttribute` | Attribute Reference | No | Attribute linking to the resource |
56
- | `cf.cplace.resourceManagement.planningItemAttribute` | Attribute Reference | No | Attribute linking to the planning item |
57
- | `cf.cplace.resourceManagement.icon` | Text/Icon | No | Icon displayed in Resource Management widgets |
55
+ | Attribute | Internal Name | Type | Required | Description |
56
+ |-----------|---------------|------|----------|-------------|
57
+ | Value Type | `cf.cplace.resourceManagement.type` | Text (type name, dynamic enumeration) | Yes | The type to be used as a value type |
58
+ | Attribute for Resource | `cf.cplace.resourceManagement.resourceAttribute` | Text (attribute name, dynamic enumeration) | No | Attribute linking to the resource |
59
+ | Attribute for Planning Item | `cf.cplace.resourceManagement.planningItemAttribute` | Text (attribute name, dynamic enumeration) | No | Attribute linking to the planning item |
60
+ | Requested Demand | `cf.cplace.resourceManagement.requestedDemandAttribute` | Time-bounded value mapping | No | Attribute holding the requested demand of the value type |
61
+ | Allocation | `cf.cplace.resourceManagement.allocationAttribute` | Time-bounded value mapping | No | Attribute holding the allocation of the value type |
62
+ | Icon | `cf.cplace.resourceManagement.icon` | Icon | No | Icon displayed in Resource Management widgets |
58
63
 
59
- ### cf.cplace.resourceManagement.tooltip
64
+ ### cf.cplace.resourceManagement.tooltip (Tooltip)
60
65
 
61
66
  Configures custom tooltips for the Resource Planner widget.
62
67
 
63
- | Attribute | Type | Required | Description |
64
- |-----------|------|----------|-------------|
65
- | `cf.cplace.resourceManagement.isActive` | Boolean | Yes | Whether this tooltip is active |
66
- | `cf.cplace.resourceManagement.isDefault` | Boolean | Yes | Whether this is the default tooltip for all types |
67
- | `cf.cplace.resourceManagement.referencedTypes` | Type Reference | No | Specific types this tooltip applies to (multi-value) |
68
- | `cf.cplace.resourceManagement.script` | Text/Script | No | cplaceJS script to generate custom tooltip content |
68
+ | Attribute | Internal Name | Type | Required | Description |
69
+ |-----------|---------------|------|----------|-------------|
70
+ | Activated | `cf.cplace.resourceManagement.isActive` | Boolean | No | Whether this tooltip is active (default false) |
71
+ | Default Tooltip | `cf.cplace.resourceManagement.isDefault` | Boolean | No | Whether this is the default tooltip for all types (default false) |
72
+ | Referenced Type | `cf.cplace.resourceManagement.referencedTypes` | Text (type names, dynamic enumeration, multiple) | No | Specific types this tooltip applies to |
73
+ | Script | `cf.cplace.resourceManagement.script` | Script | No | cplaceJS script to generate custom tooltip content |
69
74
 
70
75
  ## Widgets Provided
71
76
 
@@ -105,6 +110,13 @@ The Resource Planner widget provides:
105
110
  |-----|---------|
106
111
  | `cf.cplace.resourceManagement.resourceManagementChart` | Additional chart visualizations for resource data |
107
112
  | `cf.cplace.projectPlanning.app.basic.basicScheduleManagement` | Schedule, Task, Milestone types that can be used as planning items |
113
+ | `cf.cplace.resourceManagement.predefinedValueTypes` | Optional companion: adds the value types "Resource Request" and "Resource Answer" and their Value Type Configurations |
114
+
115
+ ### Optional Companion: Predefined Value Types
116
+
117
+ `cf.cplace.resourceManagement.predefinedValueTypes` (Value Types "Resource Request" and "Resource Answer") is a
118
+ separate app that requires this one. Install it when the solution plans with requests and answers instead of
119
+ defining its own value type; it brings the two types and configures them as value types.
108
120
 
109
121
  ### Prerequisites
110
122
 
@@ -0,0 +1,67 @@
1
+ # Value Types "Resource Request" and "Resource Answer" (cf.cplace.resourceManagement.predefinedValueTypes)
2
+
3
+ ## Overview
4
+
5
+ Adds the value types "Resource Request" and "Resource Answer" to the workspace. On install it also creates a
6
+ Value Type Configuration for each: the request's allocation is mapped as the *Requested Demand*, the answer's as
7
+ the *Allocation*. It is the optional companion of Resource Management for solutions that plan with requests and
8
+ answers rather than with a value type of their own.
9
+
10
+ **Plugin:** `cf.cplace.resourceManagement`
11
+
12
+ **Repository:** `cplace-resource-management`
13
+
14
+ ## Dependencies
15
+
16
+ When this app is installed, the following apps are automatically installed:
17
+
18
+ | App | Qualified Name | Description |
19
+ |-----|----------------|-------------|
20
+ | Resource Management | `cf.cplace.resourceManagement` | Required in the same workspace (`PredefinedValueTypesApp.getRequiredAppsInSameSpace`) |
21
+ | cplace Basis | `cf.cplace.platform` | Base platform (always installed) |
22
+
23
+ ## Types Provided
24
+
25
+ Both types share the value-type attributes of Resource Management (prefix `cf.cplace.resourceManagement.`).
26
+
27
+ ### cf.cplace.resourceManagement.request (Resource Request)
28
+
29
+ A demand for a resource on a planning item over time.
30
+
31
+ | Attribute | Internal Name | Type | Required | Description |
32
+ |-----------|---------------|------|----------|-------------|
33
+ | Resource | `cf.cplace.resourceManagement.resource` | Reference (any type) | No | The requested resource |
34
+ | Planning Item | `cf.cplace.resourceManagement.planningItem` | Reference (any type) | No | The planning item the demand is for |
35
+ | Requested Demand | `cf.cplace.resourceManagement.values` | Time-bounded values (multiple) | No | The demand per period |
36
+ | Resource Answer(s) | `cf.cplace.resourceManagement.answer` | Reference (multiple, to Resource Answer) | No | The answers to this request |
37
+ | Note | `cf.cplace.resourceManagement.note` | Long text | No | Free-text note |
38
+ | Time Range - Start | `cf.cplace.resourceManagement.startDate` | Date | No | Start of the values (read-only, derived) |
39
+ | Time Range - End | `cf.cplace.resourceManagement.endDate` | Date | No | End of the values (read-only, derived) |
40
+
41
+ ---
42
+
43
+ ### cf.cplace.resourceManagement.answer (Resource Answer)
44
+
45
+ The allocation granted in answer to a Resource Request.
46
+
47
+ | Attribute | Internal Name | Type | Required | Description |
48
+ |-----------|---------------|------|----------|-------------|
49
+ | Resource | `cf.cplace.resourceManagement.resource` | Reference (any type) | No | The allocated resource |
50
+ | Planning Item | `cf.cplace.resourceManagement.planningItem` | Reference (any type) | No | The planning item the allocation is for |
51
+ | Allocation | `cf.cplace.resourceManagement.values` | Time-bounded values (multiple) | No | The allocation per period |
52
+ | Resource Request | `cf.cplace.resourceManagement.originalRequest` | Reference (to Resource Request) | Yes | The request this answers |
53
+ | Note | `cf.cplace.resourceManagement.note` | Long text | No | Free-text note |
54
+ | Time Range - Start | `cf.cplace.resourceManagement.startDate` | Date | No | Start of the values (read-only, derived) |
55
+ | Time Range - End | `cf.cplace.resourceManagement.endDate` | Date | No | End of the values (read-only, derived) |
56
+
57
+ ## Widgets Provided
58
+
59
+ None. The Resource Planner widget comes from Resource Management.
60
+
61
+ ## Investigation Details
62
+
63
+ - **Source:** the `cplace-resource-management` source — `PredefinedValueTypesApp.java` (required app, types,
64
+ install hook), `types/RequestType.java`, `types/AnswerType.java`, `types/MixinTypes.java` (attributes),
65
+ `messages_en.properties` (labels). The qualified name follows the platform's `App.computeQualifiedName`
66
+ (package plus class name without `App`).
67
+ - **Live workspace investigation:** Not run.
@@ -1 +1 @@
1
- {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAsB5C,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAMjF;AAGD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyF5B,CAAC;AAEX,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAyS/E"}
1
+ {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AA4B5C,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAMjF;AAGD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4G5B,CAAC;AAEX,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAwW/E"}
@@ -3,9 +3,12 @@ import { debugLogWithTag } from '../logger.js';
3
3
  import { checkResponseSize } from '../utils.js';
4
4
  import { MAX_UPLOAD_BYTES } from '../types.js';
5
5
  import { validateAbsolutePath, writeFileCreatingParents, validateUploadFile, readFileForUpload, defaultFileName, } from '../utils/fileIO.js';
6
+ import { isLocalMode } from '../local-mode.js';
7
+ import { ifLocalFiles, ifNoLocalFiles, localFilesOnly } from '../capability-gating.js';
6
8
  const TOOL_GET_DOCUMENT = 'cplace_get_document';
7
9
  const TOOL_DOWNLOAD_DOCUMENT = 'cplace_download_document';
8
10
  const TOOL_UPLOAD_DOCUMENT = 'cplace_upload_document';
11
+ const HOSTED_DOWNLOAD_HINT = 'Open url in a browser while signed in to cplace to download the file. This hosted MCP server cannot save files to your disk; the local cplace MCP server (stdio) can.';
9
12
  export function formatDocumentContentError(prefix, error) {
10
13
  const message = error instanceof Error ? error.message : String(error);
11
14
  if (message.includes('(Status: 404)')) {
@@ -34,36 +37,41 @@ export const DOCUMENT_TOOL_DEFINITIONS = {
34
37
  annotations: { title: 'Get Document' },
35
38
  },
36
39
  [TOOL_DOWNLOAD_DOCUMENT]: {
37
- description: 'Download the binary file content of a document to a local file. Complements cplace_get_document, which returns extracted text only — use this tool to get the actual file (office documents, images, css/js assets, etc.). ' +
38
- 'Document UIDs are found in the documents array of page responses. ' +
39
- 'targetPath must be an absolute local path; missing parent directories are created and an existing file is overwritten silently.',
40
+ description: 'Get the file of a document. Complements cplace_get_document, which returns extracted text only — use this tool for the actual file (office documents, images, css/js assets, etc.). Document UIDs are found in the documents array of page responses. ' +
41
+ ifLocalFiles('The file is written to targetPath, an absolute local path; missing parent directories are created and an existing file is overwritten silently.') +
42
+ ifNoLocalFiles("Returns the document's cplace URL (url): the user opens it in a browser, signed in to cplace, to download the file. This hosted server cannot save files to the user's disk; that needs the local cplace MCP server (stdio). For the document's text, use cplace_get_document."),
40
43
  inputSchema: {
41
44
  documentUID: z
42
45
  .string()
43
46
  .describe("The unique identifier of the document (e.g., 'document/abc123'). Found in the documents array of page responses. (parameter name is `documentUID`, NOT `uid`)"),
44
- targetPath: z
47
+ targetPath: localFilesOnly(z
45
48
  .string()
46
- .describe("Absolute local file path to write the downloaded file to (e.g., '/tmp/report.pptx'). Parent directories are created if missing; an existing file is overwritten silently. Relative paths are rejected."),
49
+ .describe("Absolute local file path to write the downloaded file to (e.g., '/tmp/report.pptx'). Parent directories are created if missing; an existing file is overwritten silently. Relative paths are rejected.")),
47
50
  },
48
51
  annotations: { title: 'Download Document' },
49
52
  },
50
53
  [TOOL_UPLOAD_DOCUMENT]: {
51
- description: 'Upload a file as a page attachment. Provide the file bytes in exactly one of two ways: filePath (an absolute path the MCP server reads from its own filesystem — only works when the server shares your filesystem, i.e. local/stdio mode) or content (base64-encoded bytes, for when the server does not share your filesystem, e.g. a hosted server or an agent-generated file). ' +
54
+ description: ifLocalFiles('Upload a file as a page attachment. Provide the file bytes in exactly one of two ways: filePath (an absolute local path the MCP server reads) or content (base64-encoded bytes, e.g. for an agent-generated file). ') +
55
+ ifNoLocalFiles('Upload a file as a page attachment. Provide the file bytes as content (base64-encoded). ') +
52
56
  'Exactly one of pageUID (create mode) or documentUID (replace mode) must be provided. ' +
53
57
  'Create mode attaches the file as a new document on the page; if the page already has a document with the same file name, a new version of that document is written instead of creating a duplicate (platform behavior). ' +
54
58
  'Replace mode writes the file as a new version of an existing document — the document UID, name, and URL stay stable, so use this to update css/js assets referenced by widgets. ' +
55
- 'fileName applies to create mode only: it is required when content is used and defaults to the basename of filePath when filePath is used. ' +
59
+ 'fileName applies to create mode only: it is required when content is used' +
60
+ ifLocalFiles(' and defaults to the basename of filePath when filePath is used') +
61
+ '. ' +
56
62
  'When content is used its decoded size must not exceed 64 KB. ' +
57
63
  'Note: the fulltext of a freshly uploaded document becomes available asynchronously (~30s, Tika extraction).',
58
64
  inputSchema: {
59
- filePath: z
65
+ filePath: localFilesOnly(z
60
66
  .string()
61
67
  .optional()
62
- .describe("Absolute local file path of the file to upload (e.g., '/tmp/report.pptx'), read from the MCP server's own filesystem. Only usable when the server shares your filesystem (local/stdio mode). Relative paths are rejected. Provide exactly one of filePath or content."),
68
+ .describe("Absolute local file path of the file to upload (e.g., '/tmp/report.pptx'). Relative paths are rejected. Provide exactly one of filePath or content.")),
63
69
  content: z
64
70
  .string()
65
71
  .optional()
66
- .describe('Base64-encoded file bytes to upload directly, for when the MCP server does not share your filesystem (hosted/remote mode) or the file was generated in the agent context. Provide exactly one of filePath or content. When content is used, fileName is required. Decoded size must not exceed 64 KB (~87 KB of base64).'),
72
+ .describe('Base64-encoded file bytes to upload directly.' +
73
+ ifLocalFiles(' Provide exactly one of filePath or content.') +
74
+ ' When content is used, fileName is required. Decoded size must not exceed 64 KB (~87 KB of base64).'),
67
75
  pageUID: z
68
76
  .string()
69
77
  .optional()
@@ -75,7 +83,9 @@ export const DOCUMENT_TOOL_DEFINITIONS = {
75
83
  fileName: z
76
84
  .string()
77
85
  .optional()
78
- .describe('File name for the new document in create mode. Required when content is used (there is no path to derive a name from); defaults to the basename of filePath when filePath is used. Ignored in replace mode — the existing document keeps its name.'),
86
+ .describe('File name for the new document in create mode. Required when content is used (there is no path to derive a name from)' +
87
+ ifLocalFiles('; defaults to the basename of filePath when filePath is used') +
88
+ '. Ignored in replace mode — the existing document keeps its name.'),
79
89
  },
80
90
  annotations: { title: 'Upload Document' },
81
91
  },
@@ -133,7 +143,58 @@ export function registerDocumentTools(server, client) {
133
143
  }
134
144
  });
135
145
  server.registerTool(TOOL_DOWNLOAD_DOCUMENT, DOCUMENT_TOOL_DEFINITIONS[TOOL_DOWNLOAD_DOCUMENT], async ({ documentUID, targetPath }) => {
136
- debugLogWithTag('DOCUMENTS', `Downloading document: ${documentUID} to ${targetPath}`);
146
+ debugLogWithTag('DOCUMENTS', `Downloading document: ${documentUID}${targetPath === undefined ? '' : ` to ${targetPath}`}`);
147
+ if (!isLocalMode()) {
148
+ try {
149
+ const document = await client.makeApiRequest('json/document', 'GET', { documentUID });
150
+ if (typeof document?.url !== 'string' || document.url === '') {
151
+ return {
152
+ content: [
153
+ {
154
+ type: 'text',
155
+ text: `Error: cplace returned no URL for document ${documentUID}.`,
156
+ },
157
+ ],
158
+ isError: true,
159
+ };
160
+ }
161
+ const result = {
162
+ documentUID,
163
+ fileName: document.name,
164
+ mimeType: document.mimeType,
165
+ fileSize: document.fileSize,
166
+ url: document.url,
167
+ download: HOSTED_DOWNLOAD_HINT,
168
+ };
169
+ const sizeCheck = checkResponseSize(result);
170
+ if (sizeCheck.tooLarge) {
171
+ return {
172
+ content: [
173
+ {
174
+ type: 'text',
175
+ text: `Response too large (${sizeCheck.actualSize} characters, max: 45000).`,
176
+ },
177
+ ],
178
+ isError: true,
179
+ };
180
+ }
181
+ return {
182
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
183
+ };
184
+ }
185
+ catch (error) {
186
+ debugLogWithTag('DOCUMENTS', `Error getting document link: ${error instanceof Error ? error.message : String(error)}`);
187
+ return {
188
+ content: [
189
+ {
190
+ type: 'text',
191
+ text: `Error retrieving document: ${error instanceof Error ? error.message : String(error)}`,
192
+ },
193
+ ],
194
+ isError: true,
195
+ };
196
+ }
197
+ }
137
198
  const pathError = validateAbsolutePath(targetPath, 'targetPath');
138
199
  if (pathError) {
139
200
  return {
@@ -196,7 +257,9 @@ export function registerDocumentTools(server, client) {
196
257
  content: [
197
258
  {
198
259
  type: 'text',
199
- text: 'Error: Exactly one of filePath (an absolute path the server reads from its own filesystem) or content (base64-encoded file bytes) must be provided.',
260
+ text: isLocalMode()
261
+ ? 'Error: Exactly one of filePath (an absolute path the server reads from its own filesystem) or content (base64-encoded file bytes) must be provided.'
262
+ : 'Error: content (base64-encoded file bytes) must be provided.',
200
263
  },
201
264
  ],
202
265
  isError: true,
@@ -246,7 +309,7 @@ export function registerDocumentTools(server, client) {
246
309
  content: [
247
310
  {
248
311
  type: 'text',
249
- text: `Error: decoded content is ${contentBuffer.byteLength} bytes, which exceeds the ${MAX_UPLOAD_BYTES}-byte (64 KB) limit for base64 content uploads. Base64 encoding inflates size by ~33%, and the whole tool call must fit the MCP client message limit. For larger files, use filePath when the server shares your filesystem.`,
312
+ text: `Error: decoded content is ${contentBuffer.byteLength} bytes, which exceeds the ${MAX_UPLOAD_BYTES}-byte (64 KB) limit for base64 content uploads. Base64 encoding inflates size by ~33%, and the whole tool call must fit the MCP client message limit. ${isLocalMode() ? 'For larger files, use filePath.' : 'For larger files, upload them in cplace directly, or use the local cplace MCP server (stdio), which reads files from disk.'}`,
250
313
  },
251
314
  ],
252
315
  isError: true,
@@ -1 +1 @@
1
- {"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAChD,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AAC1D,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAOtD,MAAM,UAAU,0BAA0B,CAAC,MAAc,EAAE,KAAc;IACvE,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACtC,OAAO,GAAG,MAAM,KAAK,OAAO,6IAA6I,CAAC;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,EAAE;iBACtF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { DEBUG_LOGGING } from '../logger.js';
2
+ import { isDebugLogging } from '../logger.js';
3
3
  import { registerVersionCheckTool } from './version-check.js';
4
4
  import { coerceNumber } from './common-schemas.js';
5
5
  const TOOL_GET_SYSTEM_INFO = 'cplace_get_system_info';
@@ -14,7 +14,7 @@ export function registerSystemTools(server, config, client, backend, gating) {
14
14
  const systemInfo = {
15
15
  currentWorkingDirectory: process.cwd(),
16
16
  cplaceUrl: config.url || 'Not set',
17
- debugLogging: DEBUG_LOGGING,
17
+ debugLogging: isDebugLogging(),
18
18
  nodeVersion: process.version,
19
19
  platform: process.platform,
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/tools/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AACtD,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAEpD,MAAM,UAAU,mBAAmB,CACjC,MAAiB,EACjB,MAAW,EACX,MAAuB,EACvB,OAA4B,EAC5B,MAAoB;IAGpB,IAAI,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAClC,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;YACE,WAAW,EACT,wHAAwH;YAC1H,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE;SACjD,EACD,KAAK,IAAI,EAAE;YACT,MAAM,UAAU,GAAG;gBACjB,uBA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AAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC/F;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAGF,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC"}
@@ -1,3 +1,6 @@
1
+ export declare class LocalFilesDisabledError extends Error {
2
+ constructor();
3
+ }
1
4
  export declare function validateAbsolutePath(path: string, paramName: string): string | null;
2
5
  export declare function writeFileCreatingParents(targetPath: string, data: Buffer): Promise<void>;
3
6
  export declare function validateUploadFile(filePath: string): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"fileIO.d.ts","sourceRoot":"","sources":["../../src/utils/fileIO.ts"],"names":[],"mappings":"AAiBA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKnF;AAKD,wBAAsB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9F;AAQD,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAiBpE;AAKD,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzE;AAKD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD"}
1
+ {"version":3,"file":"fileIO.d.ts","sourceRoot":"","sources":["../../src/utils/fileIO.ts"],"names":[],"mappings":"AAcA,qBAAa,uBAAwB,SAAQ,KAAK;;CAKjD;AAaD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKnF;AAKD,wBAAsB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI9F;AAQD,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBpE;AAKD,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGzE;AAKD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -1,5 +1,16 @@
1
1
  import { mkdir, writeFile, stat, readFile } from 'fs/promises';
2
2
  import { isAbsolute, dirname, basename } from 'path';
3
+ import { isLocalMode } from '../local-mode.js';
4
+ export class LocalFilesDisabledError extends Error {
5
+ constructor() {
6
+ super('Local file access is disabled: this MCP server is not running in local (stdio) mode.');
7
+ this.name = 'LocalFilesDisabledError';
8
+ }
9
+ }
10
+ function assertLocalFiles() {
11
+ if (!isLocalMode())
12
+ throw new LocalFilesDisabledError();
13
+ }
3
14
  export function validateAbsolutePath(path, paramName) {
4
15
  if (!isAbsolute(path)) {
5
16
  return `Error: ${paramName} must be an absolute path (got: '${path}'). Relative paths are not supported because the MCP server's working directory is not predictable.`;
@@ -7,10 +18,12 @@ export function validateAbsolutePath(path, paramName) {
7
18
  return null;
8
19
  }
9
20
  export async function writeFileCreatingParents(targetPath, data) {
21
+ assertLocalFiles();
10
22
  await mkdir(dirname(targetPath), { recursive: true });
11
23
  await writeFile(targetPath, data);
12
24
  }
13
25
  export async function validateUploadFile(filePath) {
26
+ assertLocalFiles();
14
27
  let stats;
15
28
  try {
16
29
  stats = await stat(filePath);
@@ -30,6 +43,7 @@ export async function validateUploadFile(filePath) {
30
43
  return { ok: true, size: stats.size };
31
44
  }
32
45
  export async function readFileForUpload(filePath) {
46
+ assertLocalFiles();
33
47
  return readFile(filePath);
34
48
  }
35
49
  export function defaultFileName(filePath) {
@@ -1 +1 @@
1
- {"version":3,"file":"fileIO.js","sourceRoot":"","sources":["../../src/utils/fileIO.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AASrD,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,SAAiB;IAClE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,UAAU,SAAS,oCAAoC,IAAI,qGAAqG,CAAC;IAC1K,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAKD,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,UAAkB,EAAE,IAAY;IAC7E,MAAM,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,MAAM,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAQD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAgB;IAEhB,IAAI,KAAK,CAAC;IACV,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,2BAA2B,QAAQ,kDAAkD;SAC7F,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAAK,CAAC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E,gBAAgB,EAAE,CAAC;IACnB,MAAM,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,MAAM,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAQD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAgB;IAGhB,gBAAgB,EAAE,CAAC;IACnB,IAAI,KAAK,CAAC;IACV,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,2BAA2B,QAAQ,kDAAkD;SAC7F,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QACpB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,+BAA+B,QAAQ,0FAA0F;SACzI,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC;AAKD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IACtD,gBAAgB,EAAE,CAAC;IACnB,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC;AAKD,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cplace/mcp-server",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "MCP server that provides Claude Desktop with tools to interact with cplace APIs",
5
5
  "main": "dist/public-api.js",
6
6
  "types": "dist/public-api.d.ts",
@@ -54,7 +54,7 @@
54
54
  "cplace_search_filters.md"
55
55
  ],
56
56
  "engines": {
57
- "node": ">=22.0.0"
57
+ "node": "^22.23.4 || >=24.22.1"
58
58
  },
59
59
  "overrides": {
60
60
  "@hono/node-server": "^2.0.11",