@ifc-lite/mcp 0.2.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.
Files changed (155) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +186 -0
  3. package/dist/auth/index.d.ts +3 -0
  4. package/dist/auth/index.d.ts.map +1 -0
  5. package/dist/auth/index.js +5 -0
  6. package/dist/auth/index.js.map +1 -0
  7. package/dist/auth/scope.d.ts +24 -0
  8. package/dist/auth/scope.d.ts.map +1 -0
  9. package/dist/auth/scope.js +26 -0
  10. package/dist/auth/scope.js.map +1 -0
  11. package/dist/browser.d.ts +37 -0
  12. package/dist/browser.d.ts.map +1 -0
  13. package/dist/browser.js +37 -0
  14. package/dist/browser.js.map +1 -0
  15. package/dist/cli.d.ts +3 -0
  16. package/dist/cli.d.ts.map +1 -0
  17. package/dist/cli.js +233 -0
  18. package/dist/cli.js.map +1 -0
  19. package/dist/context.d.ts +87 -0
  20. package/dist/context.d.ts.map +1 -0
  21. package/dist/context.js +41 -0
  22. package/dist/context.js.map +1 -0
  23. package/dist/errors.d.ts +37 -0
  24. package/dist/errors.d.ts.map +1 -0
  25. package/dist/errors.js +49 -0
  26. package/dist/errors.js.map +1 -0
  27. package/dist/headless-backend.d.ts +61 -0
  28. package/dist/headless-backend.d.ts.map +1 -0
  29. package/dist/headless-backend.js +472 -0
  30. package/dist/headless-backend.js.map +1 -0
  31. package/dist/index.d.ts +39 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +49 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/loader.d.ts +9 -0
  36. package/dist/loader.d.ts.map +1 -0
  37. package/dist/loader.js +76 -0
  38. package/dist/loader.js.map +1 -0
  39. package/dist/prompts/index.d.ts +6 -0
  40. package/dist/prompts/index.d.ts.map +1 -0
  41. package/dist/prompts/index.js +13 -0
  42. package/dist/prompts/index.js.map +1 -0
  43. package/dist/prompts/templates.d.ts +21 -0
  44. package/dist/prompts/templates.d.ts.map +1 -0
  45. package/dist/prompts/templates.js +238 -0
  46. package/dist/prompts/templates.js.map +1 -0
  47. package/dist/prompts/types.d.ts +17 -0
  48. package/dist/prompts/types.d.ts.map +1 -0
  49. package/dist/prompts/types.js +27 -0
  50. package/dist/prompts/types.js.map +1 -0
  51. package/dist/protocol/index.d.ts +3 -0
  52. package/dist/protocol/index.d.ts.map +1 -0
  53. package/dist/protocol/index.js +6 -0
  54. package/dist/protocol/index.js.map +1 -0
  55. package/dist/protocol/jsonrpc.d.ts +12 -0
  56. package/dist/protocol/jsonrpc.d.ts.map +1 -0
  57. package/dist/protocol/jsonrpc.js +62 -0
  58. package/dist/protocol/jsonrpc.js.map +1 -0
  59. package/dist/protocol/types.d.ts +223 -0
  60. package/dist/protocol/types.d.ts.map +1 -0
  61. package/dist/protocol/types.js +37 -0
  62. package/dist/protocol/types.js.map +1 -0
  63. package/dist/resources/index.d.ts +6 -0
  64. package/dist/resources/index.d.ts.map +1 -0
  65. package/dist/resources/index.js +13 -0
  66. package/dist/resources/index.js.map +1 -0
  67. package/dist/resources/providers.d.ts +3 -0
  68. package/dist/resources/providers.d.ts.map +1 -0
  69. package/dist/resources/providers.js +270 -0
  70. package/dist/resources/providers.js.map +1 -0
  71. package/dist/resources/types.d.ts +29 -0
  72. package/dist/resources/types.d.ts.map +1 -0
  73. package/dist/resources/types.js +30 -0
  74. package/dist/resources/types.js.map +1 -0
  75. package/dist/server.d.ts +93 -0
  76. package/dist/server.d.ts.map +1 -0
  77. package/dist/server.js +396 -0
  78. package/dist/server.js.map +1 -0
  79. package/dist/tools/bcf.d.ts +3 -0
  80. package/dist/tools/bcf.d.ts.map +1 -0
  81. package/dist/tools/bcf.js +208 -0
  82. package/dist/tools/bcf.js.map +1 -0
  83. package/dist/tools/bsdd.d.ts +3 -0
  84. package/dist/tools/bsdd.d.ts.map +1 -0
  85. package/dist/tools/bsdd.js +267 -0
  86. package/dist/tools/bsdd.js.map +1 -0
  87. package/dist/tools/diff.d.ts +3 -0
  88. package/dist/tools/diff.d.ts.map +1 -0
  89. package/dist/tools/diff.js +149 -0
  90. package/dist/tools/diff.js.map +1 -0
  91. package/dist/tools/discovery.d.ts +8 -0
  92. package/dist/tools/discovery.d.ts.map +1 -0
  93. package/dist/tools/discovery.js +181 -0
  94. package/dist/tools/discovery.js.map +1 -0
  95. package/dist/tools/export.d.ts +3 -0
  96. package/dist/tools/export.d.ts.map +1 -0
  97. package/dist/tools/export.js +157 -0
  98. package/dist/tools/export.js.map +1 -0
  99. package/dist/tools/geometry.d.ts +3 -0
  100. package/dist/tools/geometry.d.ts.map +1 -0
  101. package/dist/tools/geometry.js +252 -0
  102. package/dist/tools/geometry.js.map +1 -0
  103. package/dist/tools/ids-accessor.d.ts +9 -0
  104. package/dist/tools/ids-accessor.d.ts.map +1 -0
  105. package/dist/tools/ids-accessor.js +131 -0
  106. package/dist/tools/ids-accessor.js.map +1 -0
  107. package/dist/tools/index.d.ts +21 -0
  108. package/dist/tools/index.d.ts.map +1 -0
  109. package/dist/tools/index.js +36 -0
  110. package/dist/tools/index.js.map +1 -0
  111. package/dist/tools/mutate.d.ts +3 -0
  112. package/dist/tools/mutate.d.ts.map +1 -0
  113. package/dist/tools/mutate.js +350 -0
  114. package/dist/tools/mutate.js.map +1 -0
  115. package/dist/tools/query.d.ts +3 -0
  116. package/dist/tools/query.d.ts.map +1 -0
  117. package/dist/tools/query.js +549 -0
  118. package/dist/tools/query.js.map +1 -0
  119. package/dist/tools/types.d.ts +18 -0
  120. package/dist/tools/types.d.ts.map +1 -0
  121. package/dist/tools/types.js +26 -0
  122. package/dist/tools/types.js.map +1 -0
  123. package/dist/tools/util.d.ts +19 -0
  124. package/dist/tools/util.d.ts.map +1 -0
  125. package/dist/tools/util.js +53 -0
  126. package/dist/tools/util.js.map +1 -0
  127. package/dist/tools/validation.d.ts +3 -0
  128. package/dist/tools/validation.d.ts.map +1 -0
  129. package/dist/tools/validation.js +244 -0
  130. package/dist/tools/validation.js.map +1 -0
  131. package/dist/tools/viewer.d.ts +3 -0
  132. package/dist/tools/viewer.d.ts.map +1 -0
  133. package/dist/tools/viewer.js +651 -0
  134. package/dist/tools/viewer.js.map +1 -0
  135. package/dist/transport/http.d.ts +64 -0
  136. package/dist/transport/http.d.ts.map +1 -0
  137. package/dist/transport/http.js +268 -0
  138. package/dist/transport/http.js.map +1 -0
  139. package/dist/transport/in-process.d.ts +25 -0
  140. package/dist/transport/in-process.d.ts.map +1 -0
  141. package/dist/transport/in-process.js +48 -0
  142. package/dist/transport/in-process.js.map +1 -0
  143. package/dist/transport/stdio.d.ts +33 -0
  144. package/dist/transport/stdio.d.ts.map +1 -0
  145. package/dist/transport/stdio.js +86 -0
  146. package/dist/transport/stdio.js.map +1 -0
  147. package/dist/validate.d.ts +23 -0
  148. package/dist/validate.d.ts.map +1 -0
  149. package/dist/validate.js +88 -0
  150. package/dist/validate.js.map +1 -0
  151. package/dist/viewer-manager.d.ts +51 -0
  152. package/dist/viewer-manager.d.ts.map +1 -0
  153. package/dist/viewer-manager.js +183 -0
  154. package/dist/viewer-manager.js.map +1 -0
  155. package/package.json +86 -0
@@ -0,0 +1,208 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * BCF (BIM Collaboration Format) tools (spec §7.6).
6
+ *
7
+ * Topics live inside a per-session BCF project that's lazy-created on first
8
+ * write. We keep the project per ToolContext (server-wide, not per-model)
9
+ * so an agent can collect issues across federated models, then export a
10
+ * single .bcfzip via `bcf_export`.
11
+ */
12
+ import { writeFile } from 'node:fs/promises';
13
+ import { resolve } from 'node:path';
14
+ import { addCommentToTopic, addTopicToProject, addViewpointToTopic, createBCFComment, createBCFProject, createBCFTopic, updateTopicStatus, writeBCF, } from '@ifc-lite/bcf';
15
+ import { okResult } from './util.js';
16
+ import { ToolErrorCode, ToolExecutionError } from '../errors.js';
17
+ // One project per server instance. We keep it on a module-level Map keyed by
18
+ // session — for stdio that's exactly one entry; for HTTP each session gets
19
+ // its own server, so this naturally scopes per-session.
20
+ const projectStore = new WeakMap();
21
+ function getProject(scopeKey) {
22
+ let p = projectStore.get(scopeKey);
23
+ if (!p) {
24
+ p = createBCFProject({ name: 'ifc-lite-mcp', version: '2.1' });
25
+ projectStore.set(scopeKey, p);
26
+ }
27
+ return p;
28
+ }
29
+ function findTopic(project, guid) {
30
+ return project.topics.get(guid) ?? null;
31
+ }
32
+ const bcfTopicList = {
33
+ name: 'bcf_topic_list',
34
+ description: 'List BCF topics in this session, optionally filtered by status.',
35
+ scope: 'read',
36
+ inputSchema: {
37
+ type: 'object',
38
+ properties: { status: { type: 'string' } },
39
+ additionalProperties: false,
40
+ },
41
+ handler(input, ctx) {
42
+ const project = getProject(ctx.registry);
43
+ const filter = input.status;
44
+ const topics = Array.from(project.topics.values())
45
+ .filter((t) => !filter || t.topicStatus === filter)
46
+ .map((t) => ({ guid: t.guid, title: t.title, status: t.topicStatus, type: t.topicType, priority: t.priority, comments: t.comments.length }));
47
+ return okResult(`${topics.length} topic(s).`, { count: topics.length, topics });
48
+ },
49
+ };
50
+ const bcfTopicCreate = {
51
+ name: 'bcf_topic_create',
52
+ description: 'Create a new BCF topic. Returns the GUID for follow-up calls.',
53
+ scope: 'mutate',
54
+ inputSchema: {
55
+ type: 'object',
56
+ properties: {
57
+ title: { type: 'string' },
58
+ description: { type: 'string' },
59
+ author: { type: 'string', default: 'ifc-lite-mcp' },
60
+ type: { type: 'string', default: 'Issue' },
61
+ status: { type: 'string', default: 'Open' },
62
+ priority: { type: 'string' },
63
+ assigned_to: { type: 'string' },
64
+ labels: { type: 'array', items: { type: 'string' } },
65
+ },
66
+ required: ['title'],
67
+ additionalProperties: false,
68
+ },
69
+ handler(input, ctx) {
70
+ const project = getProject(ctx.registry);
71
+ const topic = createBCFTopic({
72
+ title: input.title,
73
+ description: input.description,
74
+ author: input.author ?? 'ifc-lite-mcp',
75
+ topicType: input.type,
76
+ topicStatus: input.status,
77
+ priority: input.priority,
78
+ assignedTo: input.assigned_to,
79
+ labels: input.labels,
80
+ });
81
+ addTopicToProject(project, topic);
82
+ return okResult(`Created topic '${topic.title}'.`, { guid: topic.guid, title: topic.title });
83
+ },
84
+ };
85
+ const bcfTopicUpdate = {
86
+ name: 'bcf_topic_update',
87
+ description: 'Update topic fields or append a comment.',
88
+ scope: 'mutate',
89
+ inputSchema: {
90
+ type: 'object',
91
+ properties: {
92
+ guid: { type: 'string' },
93
+ status: { type: 'string' },
94
+ priority: { type: 'string' },
95
+ comment: { type: 'string' },
96
+ modified_by: { type: 'string', default: 'ifc-lite-mcp' },
97
+ },
98
+ required: ['guid'],
99
+ additionalProperties: false,
100
+ },
101
+ handler(input, ctx) {
102
+ const project = getProject(ctx.registry);
103
+ const topic = findTopic(project, input.guid);
104
+ if (!topic) {
105
+ throw new ToolExecutionError({ code: ToolErrorCode.ENTITY_NOT_FOUND, message: `Topic ${input.guid} not found.` });
106
+ }
107
+ const author = input.modified_by ?? 'ifc-lite-mcp';
108
+ if (typeof input.status === 'string')
109
+ updateTopicStatus(topic, input.status, author);
110
+ if (typeof input.priority === 'string')
111
+ topic.priority = input.priority;
112
+ if (typeof input.comment === 'string') {
113
+ const comment = createBCFComment({ author, comment: input.comment });
114
+ addCommentToTopic(topic, comment);
115
+ }
116
+ return okResult('Topic updated.', { guid: topic.guid, status: topic.topicStatus });
117
+ },
118
+ };
119
+ const bcfTopicClose = {
120
+ name: 'bcf_topic_close',
121
+ description: 'Mark a topic resolved (status="Closed").',
122
+ scope: 'mutate',
123
+ inputSchema: {
124
+ type: 'object',
125
+ properties: {
126
+ guid: { type: 'string' },
127
+ modified_by: { type: 'string', default: 'ifc-lite-mcp' },
128
+ },
129
+ required: ['guid'],
130
+ additionalProperties: false,
131
+ },
132
+ handler(input, ctx) {
133
+ const project = getProject(ctx.registry);
134
+ const topic = findTopic(project, input.guid);
135
+ if (!topic) {
136
+ throw new ToolExecutionError({ code: ToolErrorCode.ENTITY_NOT_FOUND, message: `Topic ${input.guid} not found.` });
137
+ }
138
+ updateTopicStatus(topic, 'Closed', input.modified_by ?? 'ifc-lite-mcp');
139
+ return okResult(`Closed ${topic.guid}.`, { guid: topic.guid });
140
+ },
141
+ };
142
+ const bcfViewpointCreate = {
143
+ name: 'bcf_viewpoint_create',
144
+ description: 'Attach a viewpoint to a topic. Selection-only viewpoints work without camera state; camera/section require a viewer integration.',
145
+ scope: 'mutate',
146
+ inputSchema: {
147
+ type: 'object',
148
+ properties: {
149
+ guid: { type: 'string' },
150
+ selection_global_ids: { type: 'array', items: { type: 'string' } },
151
+ },
152
+ required: ['guid'],
153
+ additionalProperties: false,
154
+ },
155
+ handler(input, ctx) {
156
+ const project = getProject(ctx.registry);
157
+ const topic = findTopic(project, input.guid);
158
+ if (!topic)
159
+ throw new ToolExecutionError({ code: ToolErrorCode.ENTITY_NOT_FOUND, message: `Topic ${input.guid} not found.` });
160
+ const selection = input.selection_global_ids ?? [];
161
+ const viewpoint = {
162
+ guid: cryptoRandomUuid(),
163
+ components: {
164
+ selection: selection.map((g) => ({ ifcGuid: g, OriginatingSystem: 'ifc-lite-mcp' })),
165
+ },
166
+ };
167
+ addViewpointToTopic(topic, viewpoint);
168
+ return okResult(`Viewpoint added (${selection.length} selected).`, { viewpointGuid: viewpoint.guid, selection: selection.length });
169
+ },
170
+ };
171
+ const bcfExport = {
172
+ name: 'bcf_export',
173
+ description: 'Export the in-memory BCF project as a .bcfzip file.',
174
+ scope: 'export',
175
+ inputSchema: {
176
+ type: 'object',
177
+ properties: { file_path: { type: 'string' } },
178
+ required: ['file_path'],
179
+ additionalProperties: false,
180
+ },
181
+ async handler(input, ctx) {
182
+ const project = getProject(ctx.registry);
183
+ const filePath = resolve(input.file_path);
184
+ if (ctx.config.allowedPaths && ctx.config.allowedPaths.length > 0) {
185
+ const ok = ctx.config.allowedPaths.some((p) => filePath === p || filePath.startsWith(p + '/'));
186
+ if (!ok) {
187
+ throw new ToolExecutionError({
188
+ code: ToolErrorCode.PERMISSION_DENIED,
189
+ message: `Path '${filePath}' outside allowed roots`,
190
+ });
191
+ }
192
+ }
193
+ const blob = (await writeBCF(project));
194
+ const buffer = Buffer.from(await blob.arrayBuffer());
195
+ await writeFile(filePath, buffer);
196
+ return okResult(`Wrote BCF (${buffer.length.toLocaleString()} bytes, ${project.topics.size} topic(s)) to ${filePath}.`, {
197
+ filePath,
198
+ bytes: buffer.length,
199
+ topicCount: project.topics.size,
200
+ });
201
+ },
202
+ };
203
+ function cryptoRandomUuid() {
204
+ // Node 18+ globalThis.crypto.randomUUID is always available.
205
+ return globalThis.crypto.randomUUID();
206
+ }
207
+ export const bcfTools = [bcfTopicList, bcfTopicCreate, bcfTopicUpdate, bcfTopicClose, bcfViewpointCreate, bcfExport];
208
+ //# sourceMappingURL=bcf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bcf.js","sourceRoot":"","sources":["../../src/tools/bcf.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,QAAQ,GAGT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEjE,6EAA6E;AAC7E,2EAA2E;AAC3E,wDAAwD;AACxD,MAAM,YAAY,GAAG,IAAI,OAAO,EAAsB,CAAC;AAEvD,SAAS,UAAU,CAAC,QAAgB;IAClC,IAAI,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,IA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G,GAAG,CAAC,CAAC,CAAC;YAC/F,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,MAAM,IAAI,kBAAkB,CAAC;oBAC3B,IAAI,EAAE,aAAa,CAAC,iBAAiB;oBACrC,OAAO,EAAE,SAAS,QAAQ,yBAAyB;iBACpD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAoB,CAAC;QAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACrD,MAAM,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC,cAAc,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,OAAO,CAAC,MAAM,CAAC,IAAI,iBAAiB,QAAQ,GAAG,EAAE;YACtH,QAAQ;YACR,KAAK,EAAE,MAAM,CAAC,MAAM;YACpB,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI;SAChC,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,SAAS,gBAAgB;IACvB,6DAA6D;IAC7D,OAAQ,UAAU,CAAC,MAAmC,CAAC,UAAU,EAAE,CAAC;AACtE,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAW,CAAC,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,SAAS,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Tool } from './types.js';
2
+ export declare const bsddTools: Tool[];
3
+ //# sourceMappingURL=bsdd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bsdd.d.ts","sourceRoot":"","sources":["../../src/tools/bsdd.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAsQvC,eAAO,MAAM,SAAS,EAAE,IAAI,EAAyD,CAAC"}
@@ -0,0 +1,267 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * bSDD tools (spec §7.7) — wrap `bim.bsdd.*` so an agent can resolve
6
+ * canonical buildingSMART class & property metadata from a chat without
7
+ * making raw HTTP calls.
8
+ */
9
+ import { EntityNode } from '@ifc-lite/query';
10
+ import { okResult, resolveModel } from './util.js';
11
+ import { ToolErrorCode, ToolExecutionError } from '../errors.js';
12
+ import { BsddHttpError } from '@ifc-lite/sdk';
13
+ /**
14
+ * Translate a thrown bSDD client error into a typed ToolExecutionError so the
15
+ * agent gets a stable code (RATE_LIMITED vs EXTERNAL_SERVICE_FAILED) plus a
16
+ * `Retry-After` hint when the upstream API supplied one.
17
+ */
18
+ function rethrowBsddError(err, label) {
19
+ if (err instanceof BsddHttpError) {
20
+ if (err.status === 429) {
21
+ const retry = err.retryAfterSeconds;
22
+ throw new ToolExecutionError({
23
+ code: ToolErrorCode.RATE_LIMITED,
24
+ message: `bSDD rate-limited the ${label} request (HTTP 429).`,
25
+ details: { url: err.url, status: err.status, retryAfterSeconds: retry },
26
+ hint: retry != null
27
+ ? `Retry after ${retry}s. Avoid running large search queries back-to-back with class lookups.`
28
+ : 'Avoid running large search queries back-to-back with class lookups.',
29
+ });
30
+ }
31
+ throw new ToolExecutionError({
32
+ code: ToolErrorCode.EXTERNAL_SERVICE_FAILED,
33
+ message: `bSDD ${label} failed: HTTP ${err.status} ${err.statusText}.`,
34
+ details: { url: err.url, status: err.status },
35
+ });
36
+ }
37
+ throw err;
38
+ }
39
+ // ── text-summary helpers ─────────────────────────────────────────────────
40
+ //
41
+ // Critical: most MCP clients (Claude Desktop included) only forward the
42
+ // `content[].text` field of a tool result to the model. If we leave that as
43
+ // "Found 23 results." the LLM literally cannot see the bSDD payload, even
44
+ // though `structuredContent` carries it. Build rich human-readable summaries
45
+ // here so the data survives the trip into the model's context.
46
+ function summarizeSearchResults(query, results, limit = 25) {
47
+ if (results.length === 0)
48
+ return `No bSDD classes match '${query}'.`;
49
+ const head = `bSDD search '${query}' — ${results.length} result(s)${results.length > limit ? `, showing first ${limit}` : ''}:`;
50
+ const lines = results.slice(0, limit).map((r) => {
51
+ const dict = r.dictionaryUri ? ` (${r.dictionaryUri.split('/').slice(-2).join('/')})` : '';
52
+ return `• ${r.code || r.name || '?'}${r.name && r.code !== r.name ? ` — ${r.name}` : ''}${dict}\n uri: ${r.uri}${r.definition ? `\n ${r.definition.slice(0, 220)}` : ''}`;
53
+ });
54
+ return [head, ...lines].join('\n');
55
+ }
56
+ function summarizeProperty(p) {
57
+ const tail = [];
58
+ if (p.dataType)
59
+ tail.push(`type=${p.dataType}`);
60
+ if (p.allowedValues && p.allowedValues.length > 0) {
61
+ const values = p.allowedValues.slice(0, 6).map((v) => v.value).join(', ');
62
+ tail.push(`allowed=[${values}${p.allowedValues.length > 6 ? `, …+${p.allowedValues.length - 6}` : ''}]`);
63
+ }
64
+ if (p.units && p.units.length > 0)
65
+ tail.push(`units=[${p.units.join(', ')}]`);
66
+ return `${p.name}${tail.length > 0 ? ` (${tail.join(', ')})` : ''}`;
67
+ }
68
+ function summarizeClassInfo(info, propsLimit = 40) {
69
+ // Group properties by Pset for a more useful overview.
70
+ const byPset = new Map();
71
+ for (const p of info.classProperties) {
72
+ const key = p.propertySet ?? '(no Pset)';
73
+ const list = byPset.get(key) ?? [];
74
+ list.push(p);
75
+ byPset.set(key, list);
76
+ }
77
+ const head = [
78
+ `bSDD class ${info.code}${info.name && info.name !== info.code ? ` — ${info.name}` : ''}`,
79
+ ` uri: ${info.uri}`,
80
+ ];
81
+ if (info.parentClassUri)
82
+ head.push(` parent: ${info.parentClassUri}`);
83
+ if (info.relatedIfcEntityNames && info.relatedIfcEntityNames.length > 0) {
84
+ head.push(` related IFC: ${info.relatedIfcEntityNames.join(', ')}`);
85
+ }
86
+ if (info.definition)
87
+ head.push(` definition: ${info.definition.slice(0, 400)}`);
88
+ head.push(` ${info.classProperties.length} properties across ${byPset.size} Pset(s):`);
89
+ const blocks = [...head];
90
+ let printed = 0;
91
+ for (const [psetName, props] of byPset) {
92
+ blocks.push(` • ${psetName} (${props.length}):`);
93
+ for (const p of props) {
94
+ if (printed >= propsLimit) {
95
+ blocks.push(` … +${info.classProperties.length - printed} more`);
96
+ return blocks.join('\n');
97
+ }
98
+ blocks.push(` - ${summarizeProperty(p)}`);
99
+ printed++;
100
+ }
101
+ }
102
+ return blocks.join('\n');
103
+ }
104
+ function summarizePropertySets(ifcType, sets) {
105
+ if (sets.length === 0)
106
+ return `bSDD has no property sets registered for ${ifcType}.`;
107
+ const head = `bSDD property sets for ${ifcType} — ${sets.length} Pset(s):`;
108
+ const lines = [head];
109
+ for (const set of sets) {
110
+ lines.push(`• ${set.name} (${set.properties.length} properties):`);
111
+ for (const p of set.properties.slice(0, 8))
112
+ lines.push(` - ${summarizeProperty(p)}`);
113
+ if (set.properties.length > 8)
114
+ lines.push(` - … +${set.properties.length - 8} more`);
115
+ }
116
+ return lines.join('\n');
117
+ }
118
+ function summarizeMatchCandidates(ifcType, candidates) {
119
+ if (candidates.length === 0)
120
+ return `No bSDD candidates for ${ifcType}.`;
121
+ const head = `${candidates.length} bSDD candidate(s) for ${ifcType}:`;
122
+ const lines = candidates.slice(0, 25).map((c) => `• ${c.code || c.name || '?'}${c.name && c.code !== c.name ? ` — ${c.name}` : ''}\n uri: ${c.uri}${c.definition ? `\n ${c.definition.slice(0, 200)}` : ''}`);
123
+ return [head, ...lines].join('\n');
124
+ }
125
+ const bsddSearch = {
126
+ name: 'bsdd_search',
127
+ description: 'Search the buildingSMART Data Dictionary for classes by keyword.',
128
+ scope: 'read',
129
+ inputSchema: {
130
+ type: 'object',
131
+ properties: { query: { type: 'string' } },
132
+ required: ['query'],
133
+ additionalProperties: false,
134
+ },
135
+ async handler(input, ctx) {
136
+ // bSDD is a network resource — pick any loaded model just for the
137
+ // namespace; if no models are loaded we still need a context that
138
+ // exposes `bim.bsdd`. Synthesize a stand-in model rather than
139
+ // failing on agents that ask before loading.
140
+ const loaded = ctx.registry.list()[0];
141
+ if (!loaded) {
142
+ throw new ToolExecutionError({
143
+ code: ToolErrorCode.MODEL_NOT_FOUND,
144
+ message: 'Load a model first; bSDD tools share its bim namespace.',
145
+ hint: 'Run model_load with a small IFC, or add a placeholder file via the CLI.',
146
+ });
147
+ }
148
+ try {
149
+ const query = input.query;
150
+ const results = await loaded.bim.bsdd.search(query);
151
+ return okResult(summarizeSearchResults(query, results), { query, count: results.length, results });
152
+ }
153
+ catch (err) {
154
+ rethrowBsddError(err, 'search');
155
+ }
156
+ },
157
+ };
158
+ const bsddClass = {
159
+ name: 'bsdd_class',
160
+ description: 'Full class details for an IFC entity name (e.g. "IfcWall") from bSDD.',
161
+ scope: 'read',
162
+ inputSchema: {
163
+ type: 'object',
164
+ properties: { ifc_type: { type: 'string' } },
165
+ required: ['ifc_type'],
166
+ additionalProperties: false,
167
+ },
168
+ async handler(input, ctx) {
169
+ const loaded = ctx.registry.list()[0];
170
+ if (!loaded)
171
+ throw new ToolExecutionError({ code: ToolErrorCode.MODEL_NOT_FOUND, message: 'Load a model first.' });
172
+ let info;
173
+ try {
174
+ info = await loaded.bim.bsdd.fetchClassInfo(input.ifc_type);
175
+ }
176
+ catch (err) {
177
+ rethrowBsddError(err, 'class lookup');
178
+ }
179
+ if (!info) {
180
+ throw new ToolExecutionError({
181
+ code: ToolErrorCode.ENTITY_NOT_FOUND,
182
+ message: `bSDD has no class for '${input.ifc_type}'.`,
183
+ });
184
+ }
185
+ return okResult(summarizeClassInfo(info), info);
186
+ },
187
+ };
188
+ const bsddPropertySets = {
189
+ name: 'bsdd_property_sets',
190
+ description: 'Get all property sets defined for an IFC entity in bSDD (e.g. Pset_WallCommon for IfcWall).',
191
+ scope: 'read',
192
+ inputSchema: {
193
+ type: 'object',
194
+ properties: { ifc_type: { type: 'string' } },
195
+ required: ['ifc_type'],
196
+ additionalProperties: false,
197
+ },
198
+ async handler(input, ctx) {
199
+ const loaded = ctx.registry.list()[0];
200
+ if (!loaded)
201
+ throw new ToolExecutionError({ code: ToolErrorCode.MODEL_NOT_FOUND, message: 'Load a model first.' });
202
+ try {
203
+ const ifcType = input.ifc_type;
204
+ const psets = await loaded.bim.bsdd.getPropertySets(ifcType);
205
+ const out = Array.from(psets.entries()).map(([name, props]) => ({ name, properties: props }));
206
+ return okResult(summarizePropertySets(ifcType, out), { ifcType, count: out.length, propertySets: out });
207
+ }
208
+ catch (err) {
209
+ rethrowBsddError(err, 'property-set lookup');
210
+ }
211
+ },
212
+ };
213
+ const bsddMatch = {
214
+ name: 'bsdd_match',
215
+ description: 'Suggest matching bSDD classes for an entity in the loaded model. Useful for classifying unclassified elements.',
216
+ scope: 'read',
217
+ inputSchema: {
218
+ type: 'object',
219
+ properties: {
220
+ model_id: { type: 'string' },
221
+ global_id: { type: 'string' },
222
+ express_id: { type: 'integer' },
223
+ },
224
+ additionalProperties: false,
225
+ },
226
+ async handler(input, ctx) {
227
+ const m = resolveModel(ctx, input.model_id);
228
+ let expressId = null;
229
+ if (typeof input.express_id === 'number')
230
+ expressId = input.express_id;
231
+ else if (typeof input.global_id === 'string') {
232
+ // Linear scan over IfcRoot subtypes — every model has only a small
233
+ // fraction tagged with GlobalId, so this stays cheap. The previous
234
+ // implementation iterated entityIndex.byType and assigned the first
235
+ // entity it found, completely ignoring the requested GlobalId.
236
+ const target = input.global_id;
237
+ outer: for (const [, list] of m.store.entityIndex.byType) {
238
+ for (const id of list) {
239
+ const node = new EntityNode(m.store, id);
240
+ if (node.globalId === target) {
241
+ expressId = id;
242
+ break outer;
243
+ }
244
+ }
245
+ }
246
+ if (expressId == null) {
247
+ throw new ToolExecutionError({
248
+ code: ToolErrorCode.ENTITY_NOT_FOUND,
249
+ message: `No entity with GlobalId '${target}' in this model.`,
250
+ });
251
+ }
252
+ }
253
+ if (expressId == null) {
254
+ throw new ToolExecutionError({ code: ToolErrorCode.INVALID_INPUT, message: 'Provide express_id or global_id.' });
255
+ }
256
+ const ifcType = m.store.entities.getTypeName(expressId) ?? 'Unknown';
257
+ try {
258
+ const candidates = await m.bim.bsdd.searchRelatedClasses(ifcType);
259
+ return okResult(summarizeMatchCandidates(ifcType, candidates), { ifcType, count: candidates.length, candidates });
260
+ }
261
+ catch (err) {
262
+ rethrowBsddError(err, 'related-class search');
263
+ }
264
+ },
265
+ };
266
+ export const bsddTools = [bsddSearch, bsddClass, bsddPropertySets, bsddMatch];
267
+ //# sourceMappingURL=bsdd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bsdd.js","sourceRoot":"","sources":["../../src/tools/bsdd.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,aAAa,EAAqE,MAAM,eAAe,CAAC;AAEjH;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,GAAY,EAAE,KAAa;IACnD,IAAI,GAAG,YAAY,aAAa,EAAE,CAAC;QACjC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACvB,MAAM,KAAK,GAAG,GAAG,CAAC,iBAAiB,CAAC;YACpC,MAAM,IAAI,kBAAkB,CAAC;gBAC3B,IAAI,EAAE,aAAa,CAAC,YAAY;gBAChC,OAAO,EAAE,yBAAyB,KAAK,sBAAsB;gBAC7D,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE;gBACvE,IAAI,EAAE,KAAK,IAAI,IAAI;oBACjB,CAAC,CAAC,eAAe,KAAK,wEAAw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,IAAI,IAAI,EAAE,CAAC;YACtB,MAAM,IAAI,kBAAkB,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,aAAa,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC,CAAC;QACnH,CAAC;QACD,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC;QACrE,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YAClE,OAAO,QAAQ,CACb,wBAAwB,CAAC,OAAO,EAAE,UAAU,CAAC,EAC7C,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,CAClD,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,gBAAgB,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAW,CAAC,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Tool } from './types.js';
2
+ export declare const diffTools: Tool[];
3
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/tools/diff.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AA0IvC,eAAO,MAAM,SAAS,EAAE,IAAI,EAA8B,CAAC"}