callman-mcp 0.4.0 → 0.5.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/CHANGELOG.md +37 -27
- package/README.md +33 -11
- package/dist/client/api.d.ts +83 -15
- package/dist/client/api.d.ts.map +1 -1
- package/dist/client/api.js +106 -21
- package/dist/client/api.js.map +1 -1
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js +46 -11
- package/dist/client/errors.js.map +1 -1
- package/dist/client/types.d.ts +231 -14
- package/dist/client/types.d.ts.map +1 -1
- package/dist/domain/diagram/build.d.ts +17 -17
- package/dist/domain/diagram/build.d.ts.map +1 -1
- package/dist/domain/diagram/build.js +3 -3
- package/dist/domain/diagram/build.js.map +1 -1
- package/dist/domain/diagram/layout.d.ts +1 -3
- package/dist/domain/diagram/layout.d.ts.map +1 -1
- package/dist/domain/diagram/layout.js +3 -9
- package/dist/domain/diagram/layout.js.map +1 -1
- package/dist/domain/diagram/patch.d.ts +22 -723
- package/dist/domain/diagram/patch.d.ts.map +1 -1
- package/dist/domain/diagram/patch.js +0 -53
- package/dist/domain/diagram/patch.js.map +1 -1
- package/dist/domain/diagram/summarize.d.ts +0 -1
- package/dist/domain/diagram/summarize.d.ts.map +1 -1
- package/dist/domain/diagram/summarize.js +0 -1
- package/dist/domain/diagram/summarize.js.map +1 -1
- package/dist/domain/uiTest/compose.d.ts +55 -0
- package/dist/domain/uiTest/compose.d.ts.map +1 -0
- package/dist/domain/uiTest/compose.js +228 -0
- package/dist/domain/uiTest/compose.js.map +1 -0
- package/dist/domain/uiTest/summarize.d.ts +273 -0
- package/dist/domain/uiTest/summarize.d.ts.map +1 -0
- package/dist/domain/uiTest/summarize.js +145 -0
- package/dist/domain/uiTest/summarize.js.map +1 -0
- package/dist/lib/truncate.d.ts +1 -1
- package/dist/lib/truncate.d.ts.map +1 -1
- package/dist/lib/truncate.js.map +1 -1
- package/dist/resources/docs/diagramSchema.d.ts +1 -1
- package/dist/resources/docs/diagramSchema.d.ts.map +1 -1
- package/dist/resources/docs/diagramSchema.js +1 -33
- package/dist/resources/docs/diagramSchema.js.map +1 -1
- package/dist/resources/docs/overview.d.ts +1 -1
- package/dist/resources/docs/overview.d.ts.map +1 -1
- package/dist/resources/docs/overview.js +13 -7
- package/dist/resources/docs/overview.js.map +1 -1
- package/dist/resources/docs/uiTests.d.ts +2 -0
- package/dist/resources/docs/uiTests.d.ts.map +1 -0
- package/dist/resources/docs/uiTests.js +101 -0
- package/dist/resources/docs/uiTests.js.map +1 -0
- package/dist/resources/generated/aiPacks.d.ts +1 -1
- package/dist/resources/generated/aiPacks.js +2 -2
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +13 -2
- package/dist/resources/index.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/catalog.d.ts +1 -1
- package/dist/tools/catalog.d.ts.map +1 -1
- package/dist/tools/catalog.js +31 -5
- package/dist/tools/catalog.js.map +1 -1
- package/dist/tools/diagrams.d.ts.map +1 -1
- package/dist/tools/diagrams.js +42 -328
- package/dist/tools/diagrams.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/lookups.d.ts +19 -5
- package/dist/tools/lookups.d.ts.map +1 -1
- package/dist/tools/lookups.js +77 -41
- package/dist/tools/lookups.js.map +1 -1
- package/dist/tools/shared.d.ts +5 -0
- package/dist/tools/shared.d.ts.map +1 -1
- package/dist/tools/shared.js +10 -0
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/uiTestAdmin.d.ts +4 -0
- package/dist/tools/uiTestAdmin.d.ts.map +1 -0
- package/dist/tools/uiTestAdmin.js +509 -0
- package/dist/tools/uiTestAdmin.js.map +1 -0
- package/dist/tools/uiTestRuns.d.ts +24 -0
- package/dist/tools/uiTestRuns.d.ts.map +1 -0
- package/dist/tools/uiTestRuns.js +367 -0
- package/dist/tools/uiTestRuns.js.map +1 -0
- package/dist/tools/uiTestShared.d.ts +236 -0
- package/dist/tools/uiTestShared.d.ts.map +1 -0
- package/dist/tools/uiTestShared.js +187 -0
- package/dist/tools/uiTestShared.js.map +1 -0
- package/dist/tools/uiTests.d.ts +4 -0
- package/dist/tools/uiTests.d.ts.map +1 -0
- package/dist/tools/uiTests.js +572 -0
- package/dist/tools/uiTests.js.map +1 -0
- package/dist-cjs/client/api.js +106 -21
- package/dist-cjs/client/errors.js +46 -11
- package/dist-cjs/domain/diagram/build.js +3 -3
- package/dist-cjs/domain/diagram/layout.js +3 -10
- package/dist-cjs/domain/diagram/patch.js +1 -54
- package/dist-cjs/domain/diagram/summarize.js +0 -1
- package/dist-cjs/domain/uiTest/compose.js +242 -0
- package/dist-cjs/domain/uiTest/summarize.js +155 -0
- package/dist-cjs/resources/docs/diagramSchema.js +1 -33
- package/dist-cjs/resources/docs/overview.js +13 -7
- package/dist-cjs/resources/docs/uiTests.js +103 -0
- package/dist-cjs/resources/generated/aiPacks.js +2 -2
- package/dist-cjs/resources/index.js +11 -0
- package/dist-cjs/server.js +2 -2
- package/dist-cjs/tools/catalog.js +31 -5
- package/dist-cjs/tools/diagrams.js +37 -323
- package/dist-cjs/tools/index.js +6 -0
- package/dist-cjs/tools/lookups.js +83 -46
- package/dist-cjs/tools/shared.js +12 -1
- package/dist-cjs/tools/uiTestAdmin.js +512 -0
- package/dist-cjs/tools/uiTestRuns.js +372 -0
- package/dist-cjs/tools/uiTestShared.js +202 -0
- package/dist-cjs/tools/uiTests.js +575 -0
- package/package.json +3 -3
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import type { UiTestFlow, UiTestResultRow, UiTestRunReport, UiTestSchedule } from "../../client/types.js";
|
|
2
|
+
export declare const flowSummaryView: (flow: UiTestFlow, folderPath?: string | null) => {
|
|
3
|
+
updatedAt: string | null;
|
|
4
|
+
group?: string | undefined;
|
|
5
|
+
activeVersionNumber?: number | undefined;
|
|
6
|
+
reviewStatus?: import("../../client/types.js").ScenarioReviewStatus | undefined;
|
|
7
|
+
folder: string | null;
|
|
8
|
+
tags: string[];
|
|
9
|
+
testType: string | null;
|
|
10
|
+
severity: string | null;
|
|
11
|
+
version: number | null;
|
|
12
|
+
description?: string | undefined;
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
platform: import("../../client/types.js").UiTestPlatform;
|
|
16
|
+
};
|
|
17
|
+
export declare const maskedDatasetKeys: (dataset: Record<string, string> | undefined | null) => string[];
|
|
18
|
+
export declare const settingsView: (flow: UiTestFlow) => {
|
|
19
|
+
runSettings: import("callman-core").UiTestRunSettings;
|
|
20
|
+
browserKind: import("../../client/types.js").UiTestBrowserKind | null;
|
|
21
|
+
headless: boolean | null;
|
|
22
|
+
} | {
|
|
23
|
+
runSettings: import("callman-core").UiTestRunSettings;
|
|
24
|
+
dismissPopups: string[];
|
|
25
|
+
};
|
|
26
|
+
export declare const runReportView: (report: UiTestRunReport, options?: {
|
|
27
|
+
includeNetwork?: boolean;
|
|
28
|
+
allStepData?: boolean;
|
|
29
|
+
}) => {
|
|
30
|
+
fromApprovedSnapshot?: boolean | undefined;
|
|
31
|
+
flowVersionNumber?: number | null | undefined;
|
|
32
|
+
networkTruncated?: boolean | undefined;
|
|
33
|
+
network: string | null;
|
|
34
|
+
screenshots: {
|
|
35
|
+
failure: boolean;
|
|
36
|
+
final: boolean;
|
|
37
|
+
};
|
|
38
|
+
warnings?: string[] | undefined;
|
|
39
|
+
datasetIssues?: string[] | undefined;
|
|
40
|
+
stepData?: {
|
|
41
|
+
dataTruncated?: boolean | undefined;
|
|
42
|
+
extracted?: string | null | undefined;
|
|
43
|
+
data?: string | null | undefined;
|
|
44
|
+
note?: string | undefined;
|
|
45
|
+
source?: string | undefined;
|
|
46
|
+
index: number;
|
|
47
|
+
command: string;
|
|
48
|
+
status: string;
|
|
49
|
+
error: string | null;
|
|
50
|
+
}[] | undefined;
|
|
51
|
+
failedSteps?: {
|
|
52
|
+
dataTruncated?: boolean | undefined;
|
|
53
|
+
extracted?: string | null | undefined;
|
|
54
|
+
data?: string | null | undefined;
|
|
55
|
+
note?: string | undefined;
|
|
56
|
+
source?: string | undefined;
|
|
57
|
+
index: number;
|
|
58
|
+
command: string;
|
|
59
|
+
status: string;
|
|
60
|
+
error: string | null;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
stepsTruncated?: number | undefined;
|
|
63
|
+
stepCounts: Record<string, number>;
|
|
64
|
+
steps: {
|
|
65
|
+
retries?: number | undefined;
|
|
66
|
+
healed?: string | undefined;
|
|
67
|
+
source?: string | undefined;
|
|
68
|
+
error?: string | undefined;
|
|
69
|
+
index: number;
|
|
70
|
+
command: string;
|
|
71
|
+
status: string;
|
|
72
|
+
durationMs: number | null;
|
|
73
|
+
}[];
|
|
74
|
+
error?: string | undefined;
|
|
75
|
+
startedAt: string | null;
|
|
76
|
+
finishedAt: string | null;
|
|
77
|
+
durationMs: number | null;
|
|
78
|
+
schedule?: string | undefined;
|
|
79
|
+
triggerType: string | null;
|
|
80
|
+
device?: string | null | undefined;
|
|
81
|
+
platform?: import("../../client/types.js").UiTestPlatform | undefined;
|
|
82
|
+
executor?: "server" | "desktop" | undefined;
|
|
83
|
+
reportId: string;
|
|
84
|
+
flow: {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
};
|
|
88
|
+
status: import("../../client/types.js").UiTestRunStatus;
|
|
89
|
+
} | {
|
|
90
|
+
fromApprovedSnapshot?: boolean | undefined;
|
|
91
|
+
flowVersionNumber?: number | null | undefined;
|
|
92
|
+
networkEvents: number | undefined;
|
|
93
|
+
screenshots: {
|
|
94
|
+
failure: boolean;
|
|
95
|
+
final: boolean;
|
|
96
|
+
};
|
|
97
|
+
warnings?: string[] | undefined;
|
|
98
|
+
datasetIssues?: string[] | undefined;
|
|
99
|
+
stepData?: {
|
|
100
|
+
dataTruncated?: boolean | undefined;
|
|
101
|
+
extracted?: string | null | undefined;
|
|
102
|
+
data?: string | null | undefined;
|
|
103
|
+
note?: string | undefined;
|
|
104
|
+
source?: string | undefined;
|
|
105
|
+
index: number;
|
|
106
|
+
command: string;
|
|
107
|
+
status: string;
|
|
108
|
+
error: string | null;
|
|
109
|
+
}[] | undefined;
|
|
110
|
+
failedSteps?: {
|
|
111
|
+
dataTruncated?: boolean | undefined;
|
|
112
|
+
extracted?: string | null | undefined;
|
|
113
|
+
data?: string | null | undefined;
|
|
114
|
+
note?: string | undefined;
|
|
115
|
+
source?: string | undefined;
|
|
116
|
+
index: number;
|
|
117
|
+
command: string;
|
|
118
|
+
status: string;
|
|
119
|
+
error: string | null;
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
stepsTruncated?: number | undefined;
|
|
122
|
+
stepCounts: Record<string, number>;
|
|
123
|
+
steps: {
|
|
124
|
+
retries?: number | undefined;
|
|
125
|
+
healed?: string | undefined;
|
|
126
|
+
source?: string | undefined;
|
|
127
|
+
error?: string | undefined;
|
|
128
|
+
index: number;
|
|
129
|
+
command: string;
|
|
130
|
+
status: string;
|
|
131
|
+
durationMs: number | null;
|
|
132
|
+
}[];
|
|
133
|
+
error?: string | undefined;
|
|
134
|
+
startedAt: string | null;
|
|
135
|
+
finishedAt: string | null;
|
|
136
|
+
durationMs: number | null;
|
|
137
|
+
schedule?: string | undefined;
|
|
138
|
+
triggerType: string | null;
|
|
139
|
+
device?: string | null | undefined;
|
|
140
|
+
platform?: import("../../client/types.js").UiTestPlatform | undefined;
|
|
141
|
+
executor?: "server" | "desktop" | undefined;
|
|
142
|
+
reportId: string;
|
|
143
|
+
flow: {
|
|
144
|
+
id: string;
|
|
145
|
+
name: string;
|
|
146
|
+
};
|
|
147
|
+
status: import("../../client/types.js").UiTestRunStatus;
|
|
148
|
+
} | {
|
|
149
|
+
fromApprovedSnapshot?: boolean | undefined;
|
|
150
|
+
flowVersionNumber?: number | null | undefined;
|
|
151
|
+
screenshots: {
|
|
152
|
+
failure: boolean;
|
|
153
|
+
final: boolean;
|
|
154
|
+
};
|
|
155
|
+
warnings?: string[] | undefined;
|
|
156
|
+
datasetIssues?: string[] | undefined;
|
|
157
|
+
stepData?: {
|
|
158
|
+
dataTruncated?: boolean | undefined;
|
|
159
|
+
extracted?: string | null | undefined;
|
|
160
|
+
data?: string | null | undefined;
|
|
161
|
+
note?: string | undefined;
|
|
162
|
+
source?: string | undefined;
|
|
163
|
+
index: number;
|
|
164
|
+
command: string;
|
|
165
|
+
status: string;
|
|
166
|
+
error: string | null;
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
failedSteps?: {
|
|
169
|
+
dataTruncated?: boolean | undefined;
|
|
170
|
+
extracted?: string | null | undefined;
|
|
171
|
+
data?: string | null | undefined;
|
|
172
|
+
note?: string | undefined;
|
|
173
|
+
source?: string | undefined;
|
|
174
|
+
index: number;
|
|
175
|
+
command: string;
|
|
176
|
+
status: string;
|
|
177
|
+
error: string | null;
|
|
178
|
+
}[] | undefined;
|
|
179
|
+
stepsTruncated?: number | undefined;
|
|
180
|
+
stepCounts: Record<string, number>;
|
|
181
|
+
steps: {
|
|
182
|
+
retries?: number | undefined;
|
|
183
|
+
healed?: string | undefined;
|
|
184
|
+
source?: string | undefined;
|
|
185
|
+
error?: string | undefined;
|
|
186
|
+
index: number;
|
|
187
|
+
command: string;
|
|
188
|
+
status: string;
|
|
189
|
+
durationMs: number | null;
|
|
190
|
+
}[];
|
|
191
|
+
error?: string | undefined;
|
|
192
|
+
startedAt: string | null;
|
|
193
|
+
finishedAt: string | null;
|
|
194
|
+
durationMs: number | null;
|
|
195
|
+
schedule?: string | undefined;
|
|
196
|
+
triggerType: string | null;
|
|
197
|
+
device?: string | null | undefined;
|
|
198
|
+
platform?: import("../../client/types.js").UiTestPlatform | undefined;
|
|
199
|
+
executor?: "server" | "desktop" | undefined;
|
|
200
|
+
reportId: string;
|
|
201
|
+
flow: {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
};
|
|
205
|
+
status: import("../../client/types.js").UiTestRunStatus;
|
|
206
|
+
};
|
|
207
|
+
export declare const runListRow: (report: UiTestRunReport) => {
|
|
208
|
+
failedStep?: {
|
|
209
|
+
index: number;
|
|
210
|
+
command: string;
|
|
211
|
+
} | null | undefined;
|
|
212
|
+
error?: string | undefined;
|
|
213
|
+
triggerType: string | null;
|
|
214
|
+
startedAt: string | null;
|
|
215
|
+
durationMs: number | null;
|
|
216
|
+
executor?: "server" | "desktop" | undefined;
|
|
217
|
+
reportId: string;
|
|
218
|
+
flow: {
|
|
219
|
+
id: string;
|
|
220
|
+
name: string;
|
|
221
|
+
};
|
|
222
|
+
status: import("../../client/types.js").UiTestRunStatus;
|
|
223
|
+
};
|
|
224
|
+
export declare const historyRow: (row: UiTestResultRow) => {
|
|
225
|
+
reportId?: string | undefined;
|
|
226
|
+
error?: string | undefined;
|
|
227
|
+
startedAt: string | null;
|
|
228
|
+
durationMs: number | null;
|
|
229
|
+
device?: string | undefined;
|
|
230
|
+
flow: {
|
|
231
|
+
id: string;
|
|
232
|
+
name: string;
|
|
233
|
+
};
|
|
234
|
+
status: "failed" | "stopped" | "passed";
|
|
235
|
+
source: string;
|
|
236
|
+
platform: import("../../client/types.js").UiTestPlatform;
|
|
237
|
+
};
|
|
238
|
+
export declare const scheduleView: (schedule: UiTestSchedule) => {
|
|
239
|
+
isRunning?: boolean | undefined;
|
|
240
|
+
lastRunAt: string | null;
|
|
241
|
+
lastRunStatus: string | null;
|
|
242
|
+
nextRunAt: string | null;
|
|
243
|
+
notificationConfig?: Record<string, unknown> | undefined;
|
|
244
|
+
failurePolicy?: Record<string, unknown> | undefined;
|
|
245
|
+
executionPolicy?: Record<string, unknown> | undefined;
|
|
246
|
+
description?: string | undefined;
|
|
247
|
+
customCronExpression?: string | undefined;
|
|
248
|
+
monthlyConfig?: {
|
|
249
|
+
daysOfMonth: number[];
|
|
250
|
+
times: string[];
|
|
251
|
+
} | undefined;
|
|
252
|
+
weeklyConfig?: {
|
|
253
|
+
daysOfWeek: number[];
|
|
254
|
+
times: string[];
|
|
255
|
+
} | undefined;
|
|
256
|
+
dailyConfig?: {
|
|
257
|
+
times: string[];
|
|
258
|
+
} | undefined;
|
|
259
|
+
id: string;
|
|
260
|
+
name: string;
|
|
261
|
+
flow: {
|
|
262
|
+
id: string;
|
|
263
|
+
name: string;
|
|
264
|
+
};
|
|
265
|
+
enabled: boolean;
|
|
266
|
+
triggerType: "daily" | "weekly" | "monthly" | "custom_cron";
|
|
267
|
+
timezone: string;
|
|
268
|
+
};
|
|
269
|
+
export declare const imageFromDataUrl: (dataUrl: string | null | undefined) => {
|
|
270
|
+
data: string;
|
|
271
|
+
mimeType: string;
|
|
272
|
+
} | null;
|
|
273
|
+
//# sourceMappingURL=summarize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarize.d.ts","sourceRoot":"","sources":["../../../src/domain/uiTest/summarize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAiB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAczH,eAAO,MAAM,eAAe,GAAI,MAAM,UAAU,EAAE,aAAa,MAAM,GAAG,IAAI;;;;;;;;;;;;;;CAc1E,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI,KAAG,MAAM,EACH,CAAC;AAE3F,eAAO,MAAM,YAAY,GAAI,MAAM,UAAU;;;;;;;CAG3C,CAAC;AA6BH,eAAO,MAAM,aAAa,GAAI,QAAQ,eAAe,EAAE,UAAS;IAAE,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCvH,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,QAAQ,eAAe;;;;;;;;;;;;;;;;CAahD,CAAC;AAEH,eAAO,MAAM,UAAU,GAAI,KAAK,eAAe;;;;;;;;;;;;;CAU7C,CAAC;AAEH,eAAO,MAAM,YAAY,GAAI,UAAU,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBnD,CAAC;AAGH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAI1G,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { resolveRunSettings } from "callman-core";
|
|
2
|
+
import { isMasked } from "../../lib/mask.js";
|
|
3
|
+
import { clip, jsonPreview } from "../../lib/truncate.js";
|
|
4
|
+
// Compact UI-test views: a flow row, a run timeline with the failing steps
|
|
5
|
+
// expanded, schedule rows. Screenshots never go into structuredContent —
|
|
6
|
+
// they travel as MCP image blocks (tools/uiTestRuns) or as `has…` flags.
|
|
7
|
+
const time = (value) => {
|
|
8
|
+
if (value === null || value === undefined || value === "")
|
|
9
|
+
return null;
|
|
10
|
+
const date = typeof value === "number" ? new Date(value) : new Date(String(value));
|
|
11
|
+
return Number.isNaN(date.getTime()) ? String(value) : date.toISOString();
|
|
12
|
+
};
|
|
13
|
+
export const flowSummaryView = (flow, folderPath) => ({
|
|
14
|
+
id: flow.clientId,
|
|
15
|
+
name: flow.name,
|
|
16
|
+
platform: flow.platform,
|
|
17
|
+
...(flow.description ? { description: clip(flow.description, 300) } : {}),
|
|
18
|
+
folder: folderPath ?? null,
|
|
19
|
+
tags: flow.tags ?? [],
|
|
20
|
+
testType: flow.testType ?? null,
|
|
21
|
+
severity: flow.severity ?? null,
|
|
22
|
+
version: flow.version ?? null,
|
|
23
|
+
...(flow.reviewStatus ? { reviewStatus: flow.reviewStatus } : {}),
|
|
24
|
+
...(flow.activeVersionNumber ? { activeVersionNumber: flow.activeVersionNumber } : {}),
|
|
25
|
+
...(flow.groupName ? { group: flow.groupName } : {}),
|
|
26
|
+
updatedAt: time(flow.updatedAt),
|
|
27
|
+
});
|
|
28
|
+
export const maskedDatasetKeys = (dataset) => Object.entries(dataset ?? {}).filter(([, value]) => isMasked(value)).map(([key]) => key);
|
|
29
|
+
export const settingsView = (flow) => ({
|
|
30
|
+
...(flow.platform === "web" ? { browserKind: flow.browserKind ?? null, headless: flow.headless ?? null } : { dismissPopups: flow.dismissPopups ?? [] }),
|
|
31
|
+
runSettings: resolveRunSettings(flow.runSettings ?? null),
|
|
32
|
+
});
|
|
33
|
+
const MAX_STEP_ROWS = 300;
|
|
34
|
+
const stepRow = (step, index) => ({
|
|
35
|
+
index: index + 1,
|
|
36
|
+
command: clip(step.command ?? "", 160),
|
|
37
|
+
status: step.status,
|
|
38
|
+
durationMs: step.durationMs ?? null,
|
|
39
|
+
...(step.error ? { error: clip(step.error, 500) } : {}),
|
|
40
|
+
...(step.source ? { source: step.source } : {}),
|
|
41
|
+
...(step.healed ? { healed: clip(step.healed, 200) } : {}),
|
|
42
|
+
...(step.retries ? { retries: step.retries } : {}),
|
|
43
|
+
});
|
|
44
|
+
const failedStepDetail = (step, index) => ({
|
|
45
|
+
index: index + 1,
|
|
46
|
+
command: clip(step.command ?? "", 400),
|
|
47
|
+
status: step.status,
|
|
48
|
+
error: step.error ? clip(step.error, 4000) : null,
|
|
49
|
+
...(step.source ? { source: step.source } : {}),
|
|
50
|
+
...(step.note ? { note: clip(step.note, 500) } : {}),
|
|
51
|
+
...(step.data !== undefined && step.data !== null ? { data: jsonPreview(step.data, 3000) } : {}),
|
|
52
|
+
...(step.extracted ? { extracted: jsonPreview(step.extracted, 1500) } : {}),
|
|
53
|
+
...(step.dataTruncated ? { dataTruncated: true } : {}),
|
|
54
|
+
});
|
|
55
|
+
const isFailed = (status) => status === "failed" || status === "error";
|
|
56
|
+
export const runReportView = (report, options = {}) => {
|
|
57
|
+
const steps = report.steps ?? [];
|
|
58
|
+
const counts = steps.reduce((acc, step) => ((acc[step.status] = (acc[step.status] ?? 0) + 1), acc), {});
|
|
59
|
+
const failed = steps.map((step, index) => ({ step, index })).filter(({ step }) => isFailed(step.status));
|
|
60
|
+
const withData = options.allStepData ? steps.map((step, index) => ({ step, index })).filter(({ step }) => !isFailed(step.status) && (step.data != null || step.extracted)) : [];
|
|
61
|
+
return {
|
|
62
|
+
reportId: report.id,
|
|
63
|
+
flow: { id: report.flowClientId, name: report.flowName },
|
|
64
|
+
status: report.status,
|
|
65
|
+
...(report.executor ? { executor: report.executor } : {}),
|
|
66
|
+
...(report.platform ? { platform: report.platform } : {}),
|
|
67
|
+
...(report.relay?.deviceName || report.relay?.deviceId ? { device: report.relay.deviceName ?? report.relay.deviceId } : {}),
|
|
68
|
+
triggerType: report.triggerType ?? null,
|
|
69
|
+
...(report.scheduleName ? { schedule: report.scheduleName } : {}),
|
|
70
|
+
startedAt: time(report.startedAt),
|
|
71
|
+
finishedAt: time(report.finishedAt),
|
|
72
|
+
durationMs: report.durationMs ?? null,
|
|
73
|
+
...(report.error ? { error: clip(report.error, 4000) } : {}),
|
|
74
|
+
stepCounts: counts,
|
|
75
|
+
steps: steps.slice(0, MAX_STEP_ROWS).map(stepRow),
|
|
76
|
+
...(steps.length > MAX_STEP_ROWS ? { stepsTruncated: steps.length } : {}),
|
|
77
|
+
...(failed.length > 0 ? { failedSteps: failed.slice(0, 10).map(({ step, index }) => failedStepDetail(step, index)) } : {}),
|
|
78
|
+
...(withData.length > 0 ? { stepData: withData.slice(0, 30).map(({ step, index }) => failedStepDetail(step, index)) } : {}),
|
|
79
|
+
...(report.datasetIssues?.length ? { datasetIssues: report.datasetIssues } : {}),
|
|
80
|
+
...(report.warnings?.length ? { warnings: report.warnings } : {}),
|
|
81
|
+
screenshots: {
|
|
82
|
+
failure: Boolean(report.failureScreenshot ?? report.hasFailureScreenshot),
|
|
83
|
+
final: Boolean(report.finalScreenshot ?? report.hasFinalScreenshot),
|
|
84
|
+
},
|
|
85
|
+
...(options.includeNetwork
|
|
86
|
+
? { network: jsonPreview(report.network ?? [], 12_000), ...(report.networkTruncated ? { networkTruncated: true } : {}) }
|
|
87
|
+
: (report.network?.length ?? report.networkCount)
|
|
88
|
+
? { networkEvents: report.network?.length ?? report.networkCount }
|
|
89
|
+
: {}),
|
|
90
|
+
...(report.fromApprovedSnapshot ? { fromApprovedSnapshot: true, flowVersionNumber: report.flowVersionNumber ?? null } : {}),
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export const runListRow = (report) => ({
|
|
94
|
+
reportId: report.id,
|
|
95
|
+
flow: { id: report.flowClientId, name: report.flowName },
|
|
96
|
+
status: report.status,
|
|
97
|
+
...(report.executor ? { executor: report.executor } : {}),
|
|
98
|
+
triggerType: report.triggerType ?? null,
|
|
99
|
+
startedAt: time(report.startedAt),
|
|
100
|
+
durationMs: report.durationMs ?? null,
|
|
101
|
+
...(report.error ? { error: clip(report.error, 300) } : {}),
|
|
102
|
+
...(report.steps ? { failedStep: (() => {
|
|
103
|
+
const index = report.steps.findIndex((step) => isFailed(step.status));
|
|
104
|
+
return index >= 0 ? { index: index + 1, command: clip(report.steps[index].command, 160) } : null;
|
|
105
|
+
})() } : {}),
|
|
106
|
+
});
|
|
107
|
+
export const historyRow = (row) => ({
|
|
108
|
+
flow: { id: row.flowClientId, name: row.flowName },
|
|
109
|
+
status: row.status,
|
|
110
|
+
source: row.triggeredBy === "schedule" ? "schedule" : row.triggeredBy ? row.triggeredBy : "desktop",
|
|
111
|
+
platform: row.platform,
|
|
112
|
+
...(row.deviceId ? { device: row.deviceId } : {}),
|
|
113
|
+
startedAt: time(row.startedAt),
|
|
114
|
+
durationMs: row.durationMs,
|
|
115
|
+
...(row.error ? { error: clip(row.error, 300) } : {}),
|
|
116
|
+
...(row.reportId ? { reportId: row.reportId } : {}),
|
|
117
|
+
});
|
|
118
|
+
export const scheduleView = (schedule) => ({
|
|
119
|
+
id: schedule.id,
|
|
120
|
+
name: schedule.name,
|
|
121
|
+
flow: { id: schedule.flowClientId, name: schedule.flowName },
|
|
122
|
+
enabled: schedule.enabled,
|
|
123
|
+
triggerType: schedule.triggerType,
|
|
124
|
+
timezone: schedule.timezone,
|
|
125
|
+
...(schedule.dailyConfig ? { dailyConfig: schedule.dailyConfig } : {}),
|
|
126
|
+
...(schedule.weeklyConfig ? { weeklyConfig: schedule.weeklyConfig } : {}),
|
|
127
|
+
...(schedule.monthlyConfig ? { monthlyConfig: schedule.monthlyConfig } : {}),
|
|
128
|
+
...(schedule.customCronExpression ? { customCronExpression: schedule.customCronExpression } : {}),
|
|
129
|
+
...(schedule.description ? { description: schedule.description } : {}),
|
|
130
|
+
...(schedule.executionPolicy ? { executionPolicy: schedule.executionPolicy } : {}),
|
|
131
|
+
...(schedule.failurePolicy ? { failurePolicy: schedule.failurePolicy } : {}),
|
|
132
|
+
...(schedule.notificationConfig ? { notificationConfig: schedule.notificationConfig } : {}),
|
|
133
|
+
lastRunAt: time(schedule.lastRunAt),
|
|
134
|
+
lastRunStatus: schedule.lastRunStatus ?? null,
|
|
135
|
+
nextRunAt: time(schedule.nextRunAt),
|
|
136
|
+
...(schedule.isRunning ? { isRunning: true } : {}),
|
|
137
|
+
});
|
|
138
|
+
// `data:image/jpeg;base64,…` → an MCP image block.
|
|
139
|
+
export const imageFromDataUrl = (dataUrl) => {
|
|
140
|
+
if (!dataUrl)
|
|
141
|
+
return null;
|
|
142
|
+
const match = /^data:(image\/[a-z0-9.+-]+);base64,(.+)$/i.exec(dataUrl.trim());
|
|
143
|
+
return match ? { mimeType: match[1].toLowerCase(), data: match[2] } : null;
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=summarize.js.map
|
|
@@ -0,0 +1 @@
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B,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3F,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;IACnC,aAAa,EAAE,QAAQ,CAAC,aAAa,IAAI,IAAI;IAC7C,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;IACnC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;CACnD,CAAC,CAAC;AAEH,mDAAmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAkC,EAA6C,EAAE;IAChH,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,KAAK,GAAG,2CAA2C,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,CAAC,CAAC"}
|
package/dist/lib/truncate.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface Clipped {
|
|
|
19
19
|
totalBytes: number;
|
|
20
20
|
}
|
|
21
21
|
export declare const clipBytes: (value: string, maxBytes: number) => Clipped;
|
|
22
|
-
export declare const jsonPreview: (value: unknown, max?:
|
|
22
|
+
export declare const jsonPreview: (value: unknown, max?: number) => string | null;
|
|
23
23
|
export declare const safeStringify: (value: unknown, space?: number) => string;
|
|
24
24
|
export declare const byteLength: (value: unknown) => number;
|
|
25
25
|
//# sourceMappingURL=truncate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"truncate.d.ts","sourceRoot":"","sources":["../../src/lib/truncate.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM;;;;;;;;;;;;;EAajB,CAAC;AAEH,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,KAAG,MACM,CAAC;AAEzD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,KAAG,OAM3D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"truncate.d.ts","sourceRoot":"","sources":["../../src/lib/truncate.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM;;;;;;;;;;;;;EAajB,CAAC;AAEH,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,KAAG,MACM,CAAC;AAEzD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,KAAG,OAM3D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,EAAE,MAAK,MAA4B,KAAG,MAAM,GAAG,IAIxF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,EAAE,QAAQ,MAAM,KAAG,MAM9D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,MACyC,CAAC"}
|
package/dist/lib/truncate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"truncate.js","sourceRoot":"","sources":["../../src/lib/truncate.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,yEAAyE;AACzE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,MAAM,UAAU,GAAG,CAAC,KAAc,EAAU,EAAE,CACnD,MAAM,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DIAGRAM_SCHEMA_DOC = "# Diagrams (create_diagram, update_diagram, patch_diagram)\n\nA diagram is a **DiagramDocument** (schemaVersion 1): typed nodes with positions and sizes,\nedges between nodes, a title. You write the compact form below; the server assigns ids,\nsizes from the component catalog, edge styles from the semantic, and lays the nodes out.\nEvery object is strict: a misspelled or unknown key is an error that names the valid keys,\nnever silently dropped.\n\n## Compact input\n```jsonc\n{\n \"name\": \"Order platform\", // library entry name\n \"title\": \"Order platform \u2014 runtime view\",\n \"nodes\": [\n { \"id\": \"k8s\", \"type\": \"frame\", \"label\": \"Kubernetes\", // a container\n \"style\": { \"stroke\": \"#8B5CF6\", \"fill\": \"rgba(139,92,246,0.07)\", \"textColor\": \"#8B5CF6\", \"strokeWidth\": 2, \"bold\": true } },\n { \"id\": \"gw\", \"type\": \"net.api-gateway\", \"label\": \"API Gateway\" },\n { \"id\": \"orders\",\"type\": \"net.service\", \"label\": \"Orders service\", \"parent\": \"k8s\" },\n { \"id\": \"db\", \"type\": \"db.postgres\", \"label\": \"orders db\" },\n { \"id\": \"bus\", \"type\": \"mq.kafka\", \"label\": \"events\" }\n ],\n \"edges\": [\n { \"source\": \"gw\", \"target\": \"orders\", \"label\": \"REST\", \"semantic\": \"sync\" },\n { \"source\": \"orders\", \"target\": \"db\", \"semantic\": \"sync\", \"color\": \"#10B981\" },\n { \"source\": \"orders\", \"target\": \"bus\", \"label\": \"OrderCreated\" } // \u2192 bus automatically\n ]\n}\n```\n\n## Nodes\n| Field | Type | Notes |\n| --- | --- | --- |\n| `id` | string | Stable id you reference from `parent` and edges; generated (n1, n2\u2026) when omitted |\n| `type` | string | MUST be a catalog type \u2014 `callman://diagram/components` (or one category: `callman://diagram/components/aws`). Unknown types are rejected with suggestions; `strictTypes: false` draws them as rectangles |\n| `label` | string | 1\u20133 words reads best |\n| `parent` | node id | Puts the node inside a container: `frame`, `pool.horizontal` or `pool.vertical` |\n| `position` | {x, y} | Top-left, relative to the parent container. Omit to auto-layout |\n| `size` | {width, height} | Defaults to the catalog size |\n| `style` | object | See **Styling** |\n| `rotation` | number | Degrees, clockwise |\n| `locked` / `hidden` | boolean | Locked nodes cannot be moved in the studio |\n| `data` | object | Free-form metadata kept with the node; not rendered |\n\n`line`, `arrow` and `line.dashed` are connectors in the studio's palette, not nodes \u2014 draw\nconnections as edges.\n\n## Edges\n| Field | Type | Notes |\n| --- | --- | --- |\n| `source`, `target` | node id | A container id is allowed |\n| `label` | string | |\n| `semantic` | sync \u00B7 async \u00B7 fallback \u00B7 bus | `sync` solid (request/response, default), `async` dashed (event, callback), `fallback` dotted (retry / optional path), `bus` heavy (message bus / stream \u2014 automatic when an end is a messaging component) |\n| `color` | CSS color | Line color, independent of the semantic |\n| `routing` | orthogonal \u00B7 straight \u00B7 curved | Default orthogonal (auto-routed right angles) |\n| `markerEnd` / `markerStart` | none \u00B7 classic \u00B7 classicThin \u00B7 open \u00B7 block \u00B7 diamond \u00B7 oval | Default: classicThin at the target, none at the source. Set `markerStart` for a two-way line |\n\nThe semantic owns the line pattern and width; there is no separate dash or width field on edges.\n\n## Styling (node `style`)\n| Key | Type | Notes |\n| --- | --- | --- |\n| `fill` | CSS color | Background. A translucent `rgba(r,g,b,0.07)` tints a container without hiding its children |\n| `stroke` | CSS color | Border |\n| `textColor` | CSS color | Label |\n| `strokeWidth` | number (px) | Border width |\n| `dashed` | boolean | Containers (frame) are dashed by default |\n| `dashPattern` | string | SVG dash array when dashed: `\"6 4\"` dashed, `\"1 3\"` dotted |\n| `radius` | number (px) | Corner radius (`rounded: true` for the default radius) |\n| `fontSize` | number (px) | |\n| `fontFamily` | string | |\n| `bold`, `italic`, `underline` | boolean | |\n| `align` | left \u00B7 center \u00B7 right | |\n| `verticalAlign` | top \u00B7 middle \u00B7 bottom | |\n| `shadow` | boolean | |\n| `opacity` | 0\u2013100 | |\n\nColors are CSS strings \u2014 `\"#3B82F6\"`, `\"rgb(59,130,246)\"`, `\"rgba(59,130,246,0.08)\"`, `\"tomato\"`.\nPick mid-tone colors: the studio has light and dark themes.\n\nColor-coding containers is the quickest way to make zones read at a glance:\n```jsonc\n{ \"op\": \"updateNode\", \"id\": \"k8s\", \"changes\": { \"style\": { \"stroke\": \"#8B5CF6\", \"fill\": \"rgba(139,92,246,0.07)\", \"textColor\": \"#8B5CF6\", \"strokeWidth\": 2, \"bold\": true } } }\n```\n\n## Layout\nPositions are optional; when any node lacks one the whole diagram is laid out\n(`direction`: DOWN, RIGHT, UP, LEFT). Give explicit `position: {x,y}` only when the user\nasks for a specific arrangement. Keep diagrams readable: 8\u201325 nodes, short labels, one edge\nper relationship.\n\n## Editing: patch_diagram ops\nOps describe CHANGES; the rest of the diagram stays exactly as it is. The op list below is the\nsame vocabulary the desktop's AI assistant uses \u2014 one implementation (callman-core) applies both.\n```jsonc\n{ \"op\": \"addNode\", \"node\": { \"type\": \"db.redis\", \"label\": \"cache\", \"parent\": \"k8s\" } }\n{ \"op\": \"updateNode\", \"id\": \"orders\", \"changes\": { \"label\": \"Orders API\", \"style\": { \"fill\": \"#EFF6FF\" } } }\n{ \"op\": \"updateNode\", \"id\": \"orders\", \"changes\": { \"style\": { \"fill\": null } } } // remove one style key\n{ \"op\": \"updateNode\", \"id\": \"orders\", \"changes\": { \"style\": null } } // clear the style\n{ \"op\": \"removeNode\", \"id\": \"bus\" } // its edges are removed, its children move to the top level\n{ \"op\": \"addEdge\", \"edge\": { \"source\": \"orders\", \"target\": \"cache\", \"semantic\": \"async\", \"color\": \"#F59E0B\" } }\n{ \"op\": \"updateEdge\", \"id\": \"e2\", \"changes\": { \"label\": \"gRPC\", \"semantic\": \"fallback\" } } // color is kept\n{ \"op\": \"updateEdge\", \"id\": \"e2\", \"changes\": { \"color\": null } } // back to the default color\n{ \"op\": \"removeEdge\", \"id\": \"e3\" }\n{ \"op\": \"setTitle\", \"title\": \"New title\" }\n{ \"op\": \"moveNode\", \"id\": \"orders\", \"position\": { \"x\": 320, \"y\": 80 } }\n{ \"op\": \"reparent\", \"id\": \"orders\", \"parent\": \"k8s\" } // null = top level\n{ \"op\": \"setEdgeRoute\", \"id\": \"e2\", \"routing\": \"smart\", \"sourceSide\": \"right\", \"targetSide\": \"left\" }\n{ \"op\": \"reorder\", \"id\": \"k8s\", \"index\": \"back\" }\n{ \"op\": \"setCanvas\", \"canvas\": { \"background\": \"grid\", \"defaultRouting\": \"orthogonal\" } }\n{ \"op\": \"group\", \"ids\": [\"orders\", \"db\"], \"label\": \"Order domain\" } // a new frame around them\n{ \"op\": \"ungroup\", \"id\": \"k8s\" } // members stay where they are\n{ \"op\": \"relayout\", \"scope\": \"new\" } // hint: place only the new nodes (or \"all\")\n```\n- updateNode `changes` accepts: type, label, parent (null/\"\" = top level), position, size,\n style, rotation, locked, hidden, collapsed, data. `style` and `data` MERGE into what the\n node has; a key set to null is removed.\n- updateEdge `changes` accepts: source, target, label (\"\" removes it), semantic, color,\n routing, markerEnd, markerStart, sourceSide, targetSide (null = floating).\n- Ids: a node written without an id gets a slug of its label (`orders-service`, `-2` on a\n clash); the result's `idMap` reports any id that had to change.\n- Moving a node (position, size or parent) or re-pointing an edge drops the saved route of\n the edges involved; the studio re-routes them (`reroutedEdges` in the result).\n- `relayout`: `new` (default \u2014 only new nodes get a place), `all` (re-run layout), `none`.\n- `get_diagram` (view `graph`) returns nodes and edges in this same shape \u2014 ids, parents,\n styles, colors, routing, sides \u2014 so read it before a patch.\n- If someone saved the diagram between your read and your patch, the ops are re-applied on\n the newer version automatically (they describe intent, not a whole document).\n\n## Mermaid\n- `get_diagram` view `mermaid` renders any diagram as a Mermaid flowchart (`id@{ shape, label }`\n nodes, `subgraph` containers, `e1@-->` edge ids, `-->`/`-.->`/`==>` for sync/async/bus).\n- `create_diagram` / `update_diagram` accept `source: { format: \"mermaid\", text }` instead of\n nodes: a flowchart/graph becomes nodes and edges (laid out automatically) and the text stays\n attached as the diagram's source \u2014 later ops keep it in sync (the desktop shows both).\n Bracket shapes map to component types (`[( )]` \u2192 database, `{ }` \u2192 decision, `([ ])` \u2192\n terminator \u2026); `click`, `%%` comments and unknown statements are kept untouched.\n- Any other Mermaid type (sequenceDiagram, classDiagram, erDiagram \u2026) is stored as source only:\n `get_diagram` view `source` returns it, the desktop previews it, and structural ops are\n refused with `DIAGRAM_SOURCE_UNSUPPORTED_TYPE`.\n\n## BPMN\n- A BPMN diagram keeps its truth in BPMN 2.0 XML: `create_diagram` with `kind: \"bpmn\"` (or nodes\n typed bpmn.*) writes the XML from your nodes and edges; `source: { format: \"bpmn\", text }` stores a\n file you already have (from Camunda Modeler, for example). The desktop opens it in its BPMN editor.\n- Node `type` is one of the bpmn.* types listed under DIAGRAM OPS above (bpmn.start-event,\n bpmn.user-task, bpmn.service-task, bpmn.exclusive-gateway, bpmn.parallel-gateway, bpmn.subprocess,\n bpmn.pool, bpmn.lane, bpmn.boundary-event \u2026). `data.bpmn` carries the BPMN facts:\n `eventDefinition` (message | timer | error | signal | \u2026), `attachedTo` (boundary events),\n `cancelActivity`, `isExpanded`. Edges are sequence flows; `data.bpmn` may set\n `flow: \"message\"` (between pools), `conditionExpression` and `isDefault`.\n- Pools and lanes are containers (`parent`); a boundary event's parent is its host's parent.\n New nodes need no position: they are placed after their predecessor.\n- `patch_diagram` works as on any diagram: every op lands on the XML as a minimal edit \u2014 extension\n elements, annotations and the modeler's formatting stay untouched. `get_diagram` view `source`\n returns the XML; view `graph` shows the derived nodes/edges with their `bpmn` facts.\n\n## Database diagrams (ERD)\n- A database diagram keeps its truth in a JSON database model (`source.format: \"database\"`):\n tables (`entities`) with columns, keys, indexes and comments, and relationships between them;\n the nodes on the canvas hold only positions and visibility. The desktop opens it on an ERD\n canvas; `get_diagram` view `schema` shows tables with their columns and the relationships as\n `table.column` pairs \u2014 read it before editing.\n- Create one with `create_diagram`: `tables` + `relationships` (`{ name, schema?, columns:\n [{ name, dataType, primaryKey?, nullable?, unique?, defaultValue?, comment? }] }` and\n `{ source: \"orders.user_id\", target: \"users.id\", cardinality: \"N:1\" }` \u2014 source is the child /\n foreign-key side), or nodes typed db.table / db.view / db.collection with the columns in\n `data.db.columns`, or `fromConnection` to read a real database through one of the\n workspace's connections (`introspect_database` reads the same schema without drawing it).\n- Edit with the schema ops of `patch_diagram`:\n```jsonc\n{ \"op\": \"addTable\", \"table\": { \"name\": \"payments\", \"columns\": [{ \"name\": \"id\", \"dataType\": \"uuid\", \"primaryKey\": true }, { \"name\": \"order_id\", \"dataType\": \"bigint\" }, { \"name\": \"amount\", \"dataType\": \"numeric(12,2)\" }] } }\n{ \"op\": \"addColumn\", \"table\": \"users\", \"column\": { \"name\": \"profile_id\", \"dataType\": \"uuid\", \"nullable\": true }, \"after\": \"id\" }\n{ \"op\": \"alterColumn\", \"table\": \"users\", \"column\": \"email\", \"changes\": { \"unique\": true, \"nullable\": false } }\n{ \"op\": \"removeColumn\", \"table\": \"users\", \"column\": \"nickname\" }\n{ \"op\": \"setPrimaryKey\", \"table\": \"order_items\", \"columns\": [\"order_id\", \"line\"] }\n{ \"op\": \"renameTable\", \"table\": \"users\", \"name\": \"accounts\", \"schema\": \"auth\" }\n{ \"op\": \"setTableComment\", \"table\": \"users\", \"comment\": \"People who can sign in\" }\n{ \"op\": \"addRelationship\", \"source\": \"payments.order_id\", \"target\": \"orders.id\", \"cardinality\": \"N:1\" }\n{ \"op\": \"updateRelationship\", \"relationship\": \"fk-payments-orders\", \"changes\": { \"cardinality\": \"1:1\", \"label\": \"settles\" } }\n{ \"op\": \"removeRelationship\", \"relationship\": \"fk-payments-orders\" }\n{ \"op\": \"removeTable\", \"table\": \"audit_log\" } // its relationships go with it\n{ \"op\": \"hideTable\", \"table\": \"migrations\" } // canvas only; showTable brings it back\n```\n Tables are named (`users`, `public.users`), columns as `table.column`; ids stay stable\n across renames. New tables are placed to the right of the existing ones (or laid out with\n `relayout: \"all\"`). moveNode, hideTable/showTable and setCanvas change the canvas only;\n group / ungroup / reparent do not apply.\n\n## Stored document (get_diagram view: \"full\")\n```ts\ninterface DiagramDocument {\n schemaVersion: 1; id: string;\n meta: { title: string; createdAt: string; updatedAt: string; revision?: number };\n canvas?: { background?: \"grid\" | \"dots\" | \"blank\"; gridSize?: number;\n defaultRouting?: \"orthogonal\" | \"straight\" | \"curved\" | \"smart\";\n layout?: { algorithm; direction }; viewport?: { x; y; zoom } };\n nodes: { id; type; position: {x,y}; size: {width,height}; label?; parentId?; rotation?;\n locked?; hidden?; collapsed?; collapsedSize?; style?: DiagramStyle; data? }[];\n edges: { id; source?; target?; label?; labelPosition?; routing?; sourceHandle?; targetHandle?;\n style?: DiagramStyle; markerStart?; markerEnd?; waypoints? }[];\n source?: { format: \"mermaid\" | \"bpmn\" | \"database\"; text; diagramType; grammar?; valid? };\n}\n// Stored colors are { raw: \"#3B82F6\" } (or a theme { token }); bold/italic/underline are\n// the bitmask fontStyle (1 | 2 | 4). The tools convert both ways \u2014 write plain colors.\n```\nEdge meaning is derived from `style` (dashed + dashPattern + strokeWidth) \u2014 set it with\n`semantic`, never directly.\n";
|
|
1
|
+
export declare const DIAGRAM_SCHEMA_DOC = "# Diagrams (create_diagram, update_diagram, patch_diagram)\n\nA diagram is a **DiagramDocument** (schemaVersion 1): typed nodes with positions and sizes,\nedges between nodes, a title. You write the compact form below; the server assigns ids,\nsizes from the component catalog, edge styles from the semantic, and lays the nodes out.\nEvery object is strict: a misspelled or unknown key is an error that names the valid keys,\nnever silently dropped.\n\n## Compact input\n```jsonc\n{\n \"name\": \"Order platform\", // library entry name\n \"title\": \"Order platform \u2014 runtime view\",\n \"nodes\": [\n { \"id\": \"k8s\", \"type\": \"frame\", \"label\": \"Kubernetes\", // a container\n \"style\": { \"stroke\": \"#8B5CF6\", \"fill\": \"rgba(139,92,246,0.07)\", \"textColor\": \"#8B5CF6\", \"strokeWidth\": 2, \"bold\": true } },\n { \"id\": \"gw\", \"type\": \"net.api-gateway\", \"label\": \"API Gateway\" },\n { \"id\": \"orders\",\"type\": \"net.service\", \"label\": \"Orders service\", \"parent\": \"k8s\" },\n { \"id\": \"db\", \"type\": \"db.postgres\", \"label\": \"orders db\" },\n { \"id\": \"bus\", \"type\": \"mq.kafka\", \"label\": \"events\" }\n ],\n \"edges\": [\n { \"source\": \"gw\", \"target\": \"orders\", \"label\": \"REST\", \"semantic\": \"sync\" },\n { \"source\": \"orders\", \"target\": \"db\", \"semantic\": \"sync\", \"color\": \"#10B981\" },\n { \"source\": \"orders\", \"target\": \"bus\", \"label\": \"OrderCreated\" } // \u2192 bus automatically\n ]\n}\n```\n\n## Nodes\n| Field | Type | Notes |\n| --- | --- | --- |\n| `id` | string | Stable id you reference from `parent` and edges; generated (n1, n2\u2026) when omitted |\n| `type` | string | MUST be a catalog type \u2014 `callman://diagram/components` (or one category: `callman://diagram/components/aws`). Unknown types are rejected with suggestions; `strictTypes: false` draws them as rectangles |\n| `label` | string | 1\u20133 words reads best |\n| `parent` | node id | Puts the node inside a container: `frame`, `pool.horizontal` or `pool.vertical` |\n| `position` | {x, y} | Top-left, relative to the parent container. Omit to auto-layout |\n| `size` | {width, height} | Defaults to the catalog size |\n| `style` | object | See **Styling** |\n| `rotation` | number | Degrees, clockwise |\n| `locked` / `hidden` | boolean | Locked nodes cannot be moved in the studio |\n| `data` | object | Free-form metadata kept with the node; not rendered |\n\n`line`, `arrow` and `line.dashed` are connectors in the studio's palette, not nodes \u2014 draw\nconnections as edges.\n\n## Edges\n| Field | Type | Notes |\n| --- | --- | --- |\n| `source`, `target` | node id | A container id is allowed |\n| `label` | string | |\n| `semantic` | sync \u00B7 async \u00B7 fallback \u00B7 bus | `sync` solid (request/response, default), `async` dashed (event, callback), `fallback` dotted (retry / optional path), `bus` heavy (message bus / stream \u2014 automatic when an end is a messaging component) |\n| `color` | CSS color | Line color, independent of the semantic |\n| `routing` | orthogonal \u00B7 straight \u00B7 curved | Default orthogonal (auto-routed right angles) |\n| `markerEnd` / `markerStart` | none \u00B7 classic \u00B7 classicThin \u00B7 open \u00B7 block \u00B7 diamond \u00B7 oval | Default: classicThin at the target, none at the source. Set `markerStart` for a two-way line |\n\nThe semantic owns the line pattern and width; there is no separate dash or width field on edges.\n\n## Styling (node `style`)\n| Key | Type | Notes |\n| --- | --- | --- |\n| `fill` | CSS color | Background. A translucent `rgba(r,g,b,0.07)` tints a container without hiding its children |\n| `stroke` | CSS color | Border |\n| `textColor` | CSS color | Label |\n| `strokeWidth` | number (px) | Border width |\n| `dashed` | boolean | Containers (frame) are dashed by default |\n| `dashPattern` | string | SVG dash array when dashed: `\"6 4\"` dashed, `\"1 3\"` dotted |\n| `radius` | number (px) | Corner radius (`rounded: true` for the default radius) |\n| `fontSize` | number (px) | |\n| `fontFamily` | string | |\n| `bold`, `italic`, `underline` | boolean | |\n| `align` | left \u00B7 center \u00B7 right | |\n| `verticalAlign` | top \u00B7 middle \u00B7 bottom | |\n| `shadow` | boolean | |\n| `opacity` | 0\u2013100 | |\n\nColors are CSS strings \u2014 `\"#3B82F6\"`, `\"rgb(59,130,246)\"`, `\"rgba(59,130,246,0.08)\"`, `\"tomato\"`.\nPick mid-tone colors: the studio has light and dark themes.\n\nColor-coding containers is the quickest way to make zones read at a glance:\n```jsonc\n{ \"op\": \"updateNode\", \"id\": \"k8s\", \"changes\": { \"style\": { \"stroke\": \"#8B5CF6\", \"fill\": \"rgba(139,92,246,0.07)\", \"textColor\": \"#8B5CF6\", \"strokeWidth\": 2, \"bold\": true } } }\n```\n\n## Layout\nPositions are optional; when any node lacks one the whole diagram is laid out\n(`direction`: DOWN, RIGHT, UP, LEFT). Give explicit `position: {x,y}` only when the user\nasks for a specific arrangement. Keep diagrams readable: 8\u201325 nodes, short labels, one edge\nper relationship.\n\n## Editing: patch_diagram ops\nOps describe CHANGES; the rest of the diagram stays exactly as it is. The op list below is the\nsame vocabulary the desktop's AI assistant uses \u2014 one implementation (callman-core) applies both.\n```jsonc\n{ \"op\": \"addNode\", \"node\": { \"type\": \"db.redis\", \"label\": \"cache\", \"parent\": \"k8s\" } }\n{ \"op\": \"updateNode\", \"id\": \"orders\", \"changes\": { \"label\": \"Orders API\", \"style\": { \"fill\": \"#EFF6FF\" } } }\n{ \"op\": \"updateNode\", \"id\": \"orders\", \"changes\": { \"style\": { \"fill\": null } } } // remove one style key\n{ \"op\": \"updateNode\", \"id\": \"orders\", \"changes\": { \"style\": null } } // clear the style\n{ \"op\": \"removeNode\", \"id\": \"bus\" } // its edges are removed, its children move to the top level\n{ \"op\": \"addEdge\", \"edge\": { \"source\": \"orders\", \"target\": \"cache\", \"semantic\": \"async\", \"color\": \"#F59E0B\" } }\n{ \"op\": \"updateEdge\", \"id\": \"e2\", \"changes\": { \"label\": \"gRPC\", \"semantic\": \"fallback\" } } // color is kept\n{ \"op\": \"updateEdge\", \"id\": \"e2\", \"changes\": { \"color\": null } } // back to the default color\n{ \"op\": \"removeEdge\", \"id\": \"e3\" }\n{ \"op\": \"setTitle\", \"title\": \"New title\" }\n{ \"op\": \"moveNode\", \"id\": \"orders\", \"position\": { \"x\": 320, \"y\": 80 } }\n{ \"op\": \"reparent\", \"id\": \"orders\", \"parent\": \"k8s\" } // null = top level\n{ \"op\": \"setEdgeRoute\", \"id\": \"e2\", \"routing\": \"smart\", \"sourceSide\": \"right\", \"targetSide\": \"left\" }\n{ \"op\": \"reorder\", \"id\": \"k8s\", \"index\": \"back\" }\n{ \"op\": \"setCanvas\", \"canvas\": { \"background\": \"grid\", \"defaultRouting\": \"orthogonal\" } }\n{ \"op\": \"group\", \"ids\": [\"orders\", \"db\"], \"label\": \"Order domain\" } // a new frame around them\n{ \"op\": \"ungroup\", \"id\": \"k8s\" } // members stay where they are\n{ \"op\": \"relayout\", \"scope\": \"new\" } // hint: place only the new nodes (or \"all\")\n```\n- updateNode `changes` accepts: type, label, parent (null/\"\" = top level), position, size,\n style, rotation, locked, hidden, collapsed, data. `style` and `data` MERGE into what the\n node has; a key set to null is removed.\n- updateEdge `changes` accepts: source, target, label (\"\" removes it), semantic, color,\n routing, markerEnd, markerStart, sourceSide, targetSide (null = floating).\n- Ids: a node written without an id gets a slug of its label (`orders-service`, `-2` on a\n clash); the result's `idMap` reports any id that had to change.\n- Moving a node (position, size or parent) or re-pointing an edge drops the saved route of\n the edges involved; the studio re-routes them (`reroutedEdges` in the result).\n- `relayout`: `new` (default \u2014 only new nodes get a place), `all` (re-run layout), `none`.\n- `get_diagram` (view `graph`) returns nodes and edges in this same shape \u2014 ids, parents,\n styles, colors, routing, sides \u2014 so read it before a patch.\n- If someone saved the diagram between your read and your patch, the ops are re-applied on\n the newer version automatically (they describe intent, not a whole document).\n\n## Mermaid\n- `get_diagram` view `mermaid` renders any diagram as a Mermaid flowchart (`id@{ shape, label }`\n nodes, `subgraph` containers, `e1@-->` edge ids, `-->`/`-.->`/`==>` for sync/async/bus).\n- `create_diagram` / `update_diagram` accept `source: { format: \"mermaid\", text }` instead of\n nodes: a flowchart/graph becomes nodes and edges (laid out automatically) and the text stays\n attached as the diagram's source \u2014 later ops keep it in sync (the desktop shows both).\n Bracket shapes map to component types (`[( )]` \u2192 database, `{ }` \u2192 decision, `([ ])` \u2192\n terminator \u2026); `click`, `%%` comments and unknown statements are kept untouched.\n- Any other Mermaid type (sequenceDiagram, classDiagram, erDiagram \u2026) is stored as source only:\n `get_diagram` view `source` returns it, the desktop previews it, and structural ops are\n refused with `DIAGRAM_SOURCE_UNSUPPORTED_TYPE`.\n\n## BPMN\n- A BPMN diagram keeps its truth in BPMN 2.0 XML: `create_diagram` with `kind: \"bpmn\"` (or nodes\n typed bpmn.*) writes the XML from your nodes and edges; `source: { format: \"bpmn\", text }` stores a\n file you already have (from Camunda Modeler, for example). The desktop opens it in its BPMN editor.\n- Node `type` is one of the bpmn.* types listed under DIAGRAM OPS above (bpmn.start-event,\n bpmn.user-task, bpmn.service-task, bpmn.exclusive-gateway, bpmn.parallel-gateway, bpmn.subprocess,\n bpmn.pool, bpmn.lane, bpmn.boundary-event \u2026). `data.bpmn` carries the BPMN facts:\n `eventDefinition` (message | timer | error | signal | \u2026), `attachedTo` (boundary events),\n `cancelActivity`, `isExpanded`. Edges are sequence flows; `data.bpmn` may set\n `flow: \"message\"` (between pools), `conditionExpression` and `isDefault`.\n- Pools and lanes are containers (`parent`); a boundary event's parent is its host's parent.\n New nodes need no position: they are placed after their predecessor.\n- `patch_diagram` works as on any diagram: every op lands on the XML as a minimal edit \u2014 extension\n elements, annotations and the modeler's formatting stay untouched. `get_diagram` view `source`\n returns the XML; view `graph` shows the derived nodes/edges with their `bpmn` facts.\n\n## Stored document (get_diagram view: \"full\")\n```ts\ninterface DiagramDocument {\n schemaVersion: 1; id: string;\n meta: { title: string; createdAt: string; updatedAt: string; revision?: number };\n canvas?: { background?: \"grid\" | \"dots\" | \"blank\"; gridSize?: number;\n defaultRouting?: \"orthogonal\" | \"straight\" | \"curved\" | \"smart\";\n layout?: { algorithm; direction }; viewport?: { x; y; zoom } };\n nodes: { id; type; position: {x,y}; size: {width,height}; label?; parentId?; rotation?;\n locked?; hidden?; collapsed?; collapsedSize?; style?: DiagramStyle; data? }[];\n edges: { id; source?; target?; label?; labelPosition?; routing?; sourceHandle?; targetHandle?;\n style?: DiagramStyle; markerStart?; markerEnd?; waypoints? }[];\n source?: { format: \"mermaid\"; text; diagramType; grammar?; valid? };\n}\n// Stored colors are { raw: \"#3B82F6\" } (or a theme { token }); bold/italic/underline are\n// the bitmask fontStyle (1 | 2 | 4). The tools convert both ways \u2014 write plain colors.\n```\nEdge meaning is derived from `style` (dashed + dashPattern + strokeWidth) \u2014 set it with\n`semantic`, never directly.\n";
|
|
2
2
|
//# sourceMappingURL=diagramSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagramSchema.d.ts","sourceRoot":"","sources":["../../../src/resources/docs/diagramSchema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"diagramSchema.d.ts","sourceRoot":"","sources":["../../../src/resources/docs/diagramSchema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,iuXA+K9B,CAAC"}
|
|
@@ -154,38 +154,6 @@ same vocabulary the desktop's AI assistant uses — one implementation (callman-
|
|
|
154
154
|
elements, annotations and the modeler's formatting stay untouched. \`get_diagram\` view \`source\`
|
|
155
155
|
returns the XML; view \`graph\` shows the derived nodes/edges with their \`bpmn\` facts.
|
|
156
156
|
|
|
157
|
-
## Database diagrams (ERD)
|
|
158
|
-
- A database diagram keeps its truth in a JSON database model (\`source.format: "database"\`):
|
|
159
|
-
tables (\`entities\`) with columns, keys, indexes and comments, and relationships between them;
|
|
160
|
-
the nodes on the canvas hold only positions and visibility. The desktop opens it on an ERD
|
|
161
|
-
canvas; \`get_diagram\` view \`schema\` shows tables with their columns and the relationships as
|
|
162
|
-
\`table.column\` pairs — read it before editing.
|
|
163
|
-
- Create one with \`create_diagram\`: \`tables\` + \`relationships\` (\`{ name, schema?, columns:
|
|
164
|
-
[{ name, dataType, primaryKey?, nullable?, unique?, defaultValue?, comment? }] }\` and
|
|
165
|
-
\`{ source: "orders.user_id", target: "users.id", cardinality: "N:1" }\` — source is the child /
|
|
166
|
-
foreign-key side), or nodes typed db.table / db.view / db.collection with the columns in
|
|
167
|
-
\`data.db.columns\`, or \`fromConnection\` to read a real database through one of the
|
|
168
|
-
workspace's connections (\`introspect_database\` reads the same schema without drawing it).
|
|
169
|
-
- Edit with the schema ops of \`patch_diagram\`:
|
|
170
|
-
\`\`\`jsonc
|
|
171
|
-
{ "op": "addTable", "table": { "name": "payments", "columns": [{ "name": "id", "dataType": "uuid", "primaryKey": true }, { "name": "order_id", "dataType": "bigint" }, { "name": "amount", "dataType": "numeric(12,2)" }] } }
|
|
172
|
-
{ "op": "addColumn", "table": "users", "column": { "name": "profile_id", "dataType": "uuid", "nullable": true }, "after": "id" }
|
|
173
|
-
{ "op": "alterColumn", "table": "users", "column": "email", "changes": { "unique": true, "nullable": false } }
|
|
174
|
-
{ "op": "removeColumn", "table": "users", "column": "nickname" }
|
|
175
|
-
{ "op": "setPrimaryKey", "table": "order_items", "columns": ["order_id", "line"] }
|
|
176
|
-
{ "op": "renameTable", "table": "users", "name": "accounts", "schema": "auth" }
|
|
177
|
-
{ "op": "setTableComment", "table": "users", "comment": "People who can sign in" }
|
|
178
|
-
{ "op": "addRelationship", "source": "payments.order_id", "target": "orders.id", "cardinality": "N:1" }
|
|
179
|
-
{ "op": "updateRelationship", "relationship": "fk-payments-orders", "changes": { "cardinality": "1:1", "label": "settles" } }
|
|
180
|
-
{ "op": "removeRelationship", "relationship": "fk-payments-orders" }
|
|
181
|
-
{ "op": "removeTable", "table": "audit_log" } // its relationships go with it
|
|
182
|
-
{ "op": "hideTable", "table": "migrations" } // canvas only; showTable brings it back
|
|
183
|
-
\`\`\`
|
|
184
|
-
Tables are named (\`users\`, \`public.users\`), columns as \`table.column\`; ids stay stable
|
|
185
|
-
across renames. New tables are placed to the right of the existing ones (or laid out with
|
|
186
|
-
\`relayout: "all"\`). moveNode, hideTable/showTable and setCanvas change the canvas only;
|
|
187
|
-
group / ungroup / reparent do not apply.
|
|
188
|
-
|
|
189
157
|
## Stored document (get_diagram view: "full")
|
|
190
158
|
\`\`\`ts
|
|
191
159
|
interface DiagramDocument {
|
|
@@ -198,7 +166,7 @@ interface DiagramDocument {
|
|
|
198
166
|
locked?; hidden?; collapsed?; collapsedSize?; style?: DiagramStyle; data? }[];
|
|
199
167
|
edges: { id; source?; target?; label?; labelPosition?; routing?; sourceHandle?; targetHandle?;
|
|
200
168
|
style?: DiagramStyle; markerStart?; markerEnd?; waypoints? }[];
|
|
201
|
-
source?: { format: "mermaid"
|
|
169
|
+
source?: { format: "mermaid"; text; diagramType; grammar?; valid? };
|
|
202
170
|
}
|
|
203
171
|
// Stored colors are { raw: "#3B82F6" } (or a theme { token }); bold/italic/underline are
|
|
204
172
|
// the bitmask fontStyle (1 | 2 | 4). The tools convert both ways — write plain colors.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagramSchema.js","sourceRoot":"","sources":["../../../src/resources/docs/diagramSchema.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG
|
|
1
|
+
{"version":3,"file":"diagramSchema.js","sourceRoot":"","sources":["../../../src/resources/docs/diagramSchema.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+KjC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const OVERVIEW_DOC = "# Working with Callman through MCP\n\nCallman is an API client and test platform (collections of HTTP requests, environments,\nmulti-step test scenarios, system-design diagrams). This
|
|
1
|
+
export declare const OVERVIEW_DOC = "# Working with Callman through MCP\n\nCallman is an API client and test platform (collections of HTTP requests, environments,\nmulti-step API test scenarios, UI tests for web / Android / iOS, system-design diagrams). This\nserver exposes it to you through tools; everything you do goes to the same server the Callman desktop app uses, as the user\nwhose token is configured, limited to that token's permissions and the user's workspace role.\n\n## Start here\n1. `whoami` \u2014 proves the connection and tells you the workspaces, features and which tools\n this token can use.\n2. Look before you create: `list_collections` / `get_collection_tree` / `search_requests`.\n Creating a collection whose name exists is refused on purpose.\n3. Arguments are strict: a misspelled or unknown argument is an error that lists the valid\n ones \u2014 read it and retry; nothing is silently ignored.\n4. Names work as references everywhere an id does (collection, folder, request, environment,\n scenario, UI test, diagram, workspace). Ambiguous names come back as a candidate list \u2014 pick one.\n5. Preview big writes with `dryRun: true` (bulk create, imports, scenarios, diagrams).\n6. Deletions need `confirm: true` and an exact name or id. Ask the user unless they explicitly\n requested the deletion.\n\n## Workspaces\nThe token works in EVERY workspace the user belongs to (with their role in each):\n- Lists and searches (`list_collections`, `search_requests`, `list_environments`,\n `list_connections`, `list_scenarios`) cover all workspaces unless you pass `workspace`;\n every row says which workspace it is in.\n- A name (collection, request, environment) is looked up in the default workspace first, then\n in all others; a unique match anywhere is used and the result says where it was found. The\n same name in several workspaces comes back as candidates tagged with their workspace \u2014 pass\n `workspace` or the id.\n- Creating needs one target: `workspace`, or the collection it goes into, or the session\n default. `use_workspace` changes the default for the session (it never hides the others).\n- Environments, connections and global variables belong to one workspace: a request uses the\n ones of its own workspace.\n\n## Requests\n- Use `{{variable}}` for hosts and secrets (`{{baseUrl}}/users`) and put the values in an\n environment (`create_environment` / `set_environment_variables`). Use `:id` for path\n variables. See `callman://docs/request-schema`.\n- get_request returns a request in the same shape create/update take \u2014 read, change, send back.\n- Bodies: a JSON value, a raw string, or `{ mode: raw|formdata|urlencoded|json }`.\n- Database / Kafka / Redis steps and DB assertions are request fields; connections are\n referenced by id or name (`list_connections`).\n- Contract checks (field rules, data-driven rows) \u2014 `callman://docs/contracts`.\n- Scripts run in a sandbox with the `pm.*` API \u2014 `callman://docs/scripting/pm-api`.\n- `run_request` / `run_collection` execute on the user's machine with real variable values;\n you only get results and the names of variables scripts changed.\n\n## Secrets\nEnvironment values come back masked (`\u2022\u2022\u2022\u2022ab`) unless the token holds `environments:reveal`\nand you ask for `reveal: true`. Never write a masked environment value back \u2014 it is refused.\nRequest auth secrets and sensitive headers are masked the same way; sending a masked request\nsecret back UNCHANGED keeps the stored one, anything else masked is refused.\n\n## Scenarios\nMulti-step flows as a graph of typed nodes (request, condition, assertion, set-vars, poll,\ndb, kafka, script, wait, end \u2026). Read `callman://docs/scenario-nodes` before building one;\npartial node configs are merged over defaults. Runs happen on the server (`run_scenario`).\n\n## UI tests\nBrowser and mobile-app flows (YAML: header, `---`, steps) \u2014 the desktop app's UI Testing area.\nRead `callman://docs/ui-tests` first and `callman://docs/ui-test-steps` for every step. Flows are\nlinted before they are saved (`validate_ui_test`); edit steps by number with\n`patch_ui_test_steps`. Web flows run on the server runner when there is one; Android, iOS (and\nweb without a runner) run on the user's own Callman desktop app, which must be open with\n\"Let AI tools run UI tests on this computer\" on \u2014 `list_ui_test_devices` shows what is\navailable. Runs return per-step results; screenshots come back as images on request.\n\n## Diagrams\nSystem-design diagrams use a fixed component catalog \u2014 `callman://diagram/components`.\nBuild with `create_diagram` (auto layout), edit with `patch_diagram`, share with\n`share_diagram`. See `callman://docs/diagram-schema`.\n\n## After writing\nThe desktop app refreshes when the user switches back to it. Tell the user what you created\nand where (collection / folder names).\n";
|
|
2
2
|
//# sourceMappingURL=overview.d.ts.map
|