callman-mcp 0.1.0 → 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.
- package/CHANGELOG.md +82 -0
- package/README.md +45 -16
- package/dist/client/api.d.ts +64 -3
- package/dist/client/api.d.ts.map +1 -1
- package/dist/client/api.js +67 -2
- package/dist/client/api.js.map +1 -1
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js +33 -7
- package/dist/client/errors.js.map +1 -1
- package/dist/client/types.d.ts +91 -2
- package/dist/client/types.d.ts.map +1 -1
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +7 -2
- package/dist/context.js.map +1 -1
- package/dist/domain/contracts.d.ts +893 -0
- package/dist/domain/contracts.d.ts.map +1 -0
- package/dist/domain/contracts.js +90 -0
- package/dist/domain/contracts.js.map +1 -0
- package/dist/domain/diagram/build.d.ts +520 -18
- package/dist/domain/diagram/build.d.ts.map +1 -1
- package/dist/domain/diagram/build.js +65 -19
- package/dist/domain/diagram/build.js.map +1 -1
- package/dist/domain/diagram/patch.d.ts +624 -51
- package/dist/domain/diagram/patch.d.ts.map +1 -1
- package/dist/domain/diagram/patch.js +180 -40
- package/dist/domain/diagram/patch.js.map +1 -1
- package/dist/domain/diagram/style.d.ts +315 -0
- package/dist/domain/diagram/style.d.ts.map +1 -0
- package/dist/domain/diagram/style.js +124 -0
- package/dist/domain/diagram/style.js.map +1 -0
- package/dist/domain/diagram/summarize.d.ts +8 -0
- package/dist/domain/diagram/summarize.d.ts.map +1 -1
- package/dist/domain/diagram/summarize.js +28 -13
- package/dist/domain/diagram/summarize.js.map +1 -1
- package/dist/domain/requestIntegrations.d.ts +719 -0
- package/dist/domain/requestIntegrations.d.ts.map +1 -0
- package/dist/domain/requestIntegrations.js +222 -0
- package/dist/domain/requestIntegrations.js.map +1 -0
- package/dist/domain/requestShape.d.ts +1350 -152
- package/dist/domain/requestShape.d.ts.map +1 -1
- package/dist/domain/requestShape.js +336 -121
- package/dist/domain/requestShape.js.map +1 -1
- package/dist/domain/resolve.d.ts +2 -1
- package/dist/domain/resolve.d.ts.map +1 -1
- package/dist/domain/resolve.js +5 -1
- package/dist/domain/resolve.js.map +1 -1
- package/dist/domain/scenario/build.d.ts +82 -26
- package/dist/domain/scenario/build.d.ts.map +1 -1
- package/dist/domain/scenario/build.js +196 -65
- package/dist/domain/scenario/build.js.map +1 -1
- package/dist/domain/scenario/nodeConfig.d.ts +11 -0
- package/dist/domain/scenario/nodeConfig.d.ts.map +1 -0
- package/dist/domain/scenario/nodeConfig.js +251 -0
- package/dist/domain/scenario/nodeConfig.js.map +1 -0
- package/dist/domain/scenario/summarize.d.ts +145 -25
- package/dist/domain/scenario/summarize.d.ts.map +1 -1
- package/dist/domain/scenario/summarize.js +84 -29
- package/dist/domain/scenario/summarize.js.map +1 -1
- package/dist/lib/mask.d.ts +0 -18
- package/dist/lib/mask.d.ts.map +1 -1
- package/dist/lib/mask.js +2 -44
- package/dist/lib/mask.js.map +1 -1
- package/dist/lib/pagination.d.ts +3 -2
- package/dist/lib/pagination.d.ts.map +1 -1
- package/dist/lib/pagination.js +13 -8
- package/dist/lib/pagination.js.map +1 -1
- package/dist/lib/redact.d.ts +12 -0
- package/dist/lib/redact.d.ts.map +1 -0
- package/dist/lib/redact.js +50 -0
- package/dist/lib/redact.js.map +1 -0
- package/dist/lib/strict.d.ts +4 -0
- package/dist/lib/strict.d.ts.map +1 -0
- package/dist/lib/strict.js +14 -0
- package/dist/lib/strict.js.map +1 -0
- package/dist/prompts/index.js +7 -7
- package/dist/prompts/index.js.map +1 -1
- package/dist/resources/docs/contracts.d.ts +2 -0
- package/dist/resources/docs/contracts.d.ts.map +1 -0
- package/dist/resources/docs/contracts.js +74 -0
- package/dist/resources/docs/contracts.js.map +1 -0
- 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 +95 -28
- 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 +29 -7
- package/dist/resources/docs/overview.js.map +1 -1
- package/dist/resources/docs/requestSchema.d.ts +1 -1
- package/dist/resources/docs/requestSchema.d.ts.map +1 -1
- package/dist/resources/docs/requestSchema.js +85 -16
- package/dist/resources/docs/requestSchema.js.map +1 -1
- package/dist/resources/generated/aiPacks.d.ts +1 -1
- package/dist/resources/generated/aiPacks.d.ts.map +1 -1
- package/dist/resources/generated/aiPacks.js +3 -2
- package/dist/resources/generated/aiPacks.js.map +1 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +19 -19
- package/dist/resources/index.js.map +1 -1
- package/dist/run/executeCollection.d.ts +3 -1
- package/dist/run/executeCollection.d.ts.map +1 -1
- package/dist/run/executeCollection.js +16 -4
- package/dist/run/executeCollection.js.map +1 -1
- package/dist/run/summarize.d.ts +17 -6
- package/dist/run/summarize.d.ts.map +1 -1
- package/dist/run/summarize.js +48 -41
- package/dist/run/summarize.js.map +1 -1
- package/dist/run/types.d.ts +1 -0
- package/dist/run/types.d.ts.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -1
- 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 +18 -0
- package/dist/tools/catalog.js.map +1 -1
- package/dist/tools/collections.d.ts.map +1 -1
- package/dist/tools/collections.js +53 -41
- package/dist/tools/collections.js.map +1 -1
- package/dist/tools/contracts.d.ts +4 -0
- package/dist/tools/contracts.d.ts.map +1 -0
- package/dist/tools/contracts.js +201 -0
- package/dist/tools/contracts.js.map +1 -0
- package/dist/tools/diagrams.d.ts.map +1 -1
- package/dist/tools/diagrams.js +19 -10
- package/dist/tools/diagrams.js.map +1 -1
- package/dist/tools/environments.d.ts.map +1 -1
- package/dist/tools/environments.js +184 -64
- package/dist/tools/environments.js.map +1 -1
- package/dist/tools/import.d.ts.map +1 -1
- package/dist/tools/import.js +111 -20
- package/dist/tools/import.js.map +1 -1
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +19 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/lookups.d.ts +38 -7
- package/dist/tools/lookups.d.ts.map +1 -1
- package/dist/tools/lookups.js +113 -10
- package/dist/tools/lookups.js.map +1 -1
- package/dist/tools/meta.d.ts.map +1 -1
- package/dist/tools/meta.js +9 -4
- package/dist/tools/meta.js.map +1 -1
- package/dist/tools/requests.d.ts.map +1 -1
- package/dist/tools/requests.js +138 -50
- package/dist/tools/requests.js.map +1 -1
- package/dist/tools/run.d.ts.map +1 -1
- package/dist/tools/run.js +84 -28
- package/dist/tools/run.js.map +1 -1
- package/dist/tools/scenarios.d.ts.map +1 -1
- package/dist/tools/scenarios.js +238 -75
- package/dist/tools/scenarios.js.map +1 -1
- package/dist/tools/shared.d.ts +1 -0
- package/dist/tools/shared.d.ts.map +1 -1
- package/dist/tools/shared.js +9 -1
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/workspaces.d.ts.map +1 -1
- package/dist/tools/workspaces.js +44 -7
- package/dist/tools/workspaces.js.map +1 -1
- package/dist-cjs/client/api.js +67 -2
- package/dist-cjs/client/errors.js +33 -7
- package/dist-cjs/context.js +7 -2
- package/dist-cjs/domain/contracts.js +93 -0
- package/dist-cjs/domain/diagram/build.js +71 -20
- package/dist-cjs/domain/diagram/patch.js +179 -39
- package/dist-cjs/domain/diagram/style.js +130 -0
- package/dist-cjs/domain/diagram/summarize.js +28 -13
- package/dist-cjs/domain/requestIntegrations.js +228 -0
- package/dist-cjs/domain/requestShape.js +342 -121
- package/dist-cjs/domain/resolve.js +5 -1
- package/dist-cjs/domain/scenario/build.js +197 -65
- package/dist-cjs/domain/scenario/nodeConfig.js +260 -0
- package/dist-cjs/domain/scenario/summarize.js +86 -29
- package/dist-cjs/lib/mask.js +3 -48
- package/dist-cjs/lib/pagination.js +13 -8
- package/dist-cjs/lib/redact.js +53 -0
- package/dist-cjs/lib/strict.js +18 -0
- package/dist-cjs/prompts/index.js +7 -7
- package/dist-cjs/resources/docs/contracts.js +76 -0
- package/dist-cjs/resources/docs/diagramSchema.js +95 -28
- package/dist-cjs/resources/docs/overview.js +29 -7
- package/dist-cjs/resources/docs/requestSchema.js +85 -16
- package/dist-cjs/resources/generated/aiPacks.js +3 -2
- package/dist-cjs/resources/index.js +17 -17
- package/dist-cjs/run/executeCollection.js +16 -4
- package/dist-cjs/run/summarize.js +48 -41
- package/dist-cjs/server.js +1 -1
- package/dist-cjs/tools/catalog.js +18 -0
- package/dist-cjs/tools/collections.js +52 -40
- package/dist-cjs/tools/contracts.js +204 -0
- package/dist-cjs/tools/diagrams.js +19 -10
- package/dist-cjs/tools/environments.js +182 -62
- package/dist-cjs/tools/import.js +107 -16
- package/dist-cjs/tools/index.js +21 -2
- package/dist-cjs/tools/lookups.js +123 -11
- package/dist-cjs/tools/meta.js +9 -4
- package/dist-cjs/tools/requests.js +134 -46
- package/dist-cjs/tools/run.js +82 -26
- package/dist-cjs/tools/scenarios.js +235 -72
- package/dist-cjs/tools/shared.js +11 -2
- package/dist-cjs/tools/workspaces.js +43 -6
- package/package.json +2 -2
package/dist/lib/pagination.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export interface PageCursor {
|
|
2
2
|
page: number;
|
|
3
3
|
limit: number;
|
|
4
|
+
q?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare const encodeCursor: (cursor: PageCursor) => string;
|
|
6
7
|
export declare const decodeCursor: (raw: string | undefined | null) => PageCursor | null;
|
|
7
8
|
export declare const clampLimit: (limit: number | undefined) => number;
|
|
8
|
-
export declare const pageFromCursor: (cursor: string | undefined, limit: number | undefined) => PageCursor;
|
|
9
|
+
export declare const pageFromCursor: (cursor: string | undefined, limit: number | undefined, q?: string) => PageCursor;
|
|
9
10
|
export interface BackendPagination {
|
|
10
11
|
page: number;
|
|
11
12
|
limit: number;
|
|
@@ -13,7 +14,7 @@ export interface BackendPagination {
|
|
|
13
14
|
totalPages: number;
|
|
14
15
|
}
|
|
15
16
|
export declare const nextCursorFor: (pagination: BackendPagination) => string | null;
|
|
16
|
-
export declare const sliceWithCursor: <T>(items: T[], cursor: string | undefined, limit: number | undefined) => {
|
|
17
|
+
export declare const sliceWithCursor: <T>(items: T[], cursor: string | undefined, limit: number | undefined, q?: string) => {
|
|
17
18
|
items: T[];
|
|
18
19
|
total: number;
|
|
19
20
|
nextCursor: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/lib/pagination.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/lib/pagination.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAGd,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,UAAU,KAAG,MACiB,CAAC;AAEpE,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,GAAG,SAAS,GAAG,IAAI,KAAG,UAAU,GAAG,IAU1E,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,MAC2B,CAAC;AAEnF,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,GAAG,SAAS,EAAE,OAAO,MAAM,GAAG,SAAS,EAAE,UAAM,KAAG,UAM9F,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,GAAI,YAAY,iBAAiB,KAAG,MAAM,GAAG,IAG7D,CAAC;AAGX,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,MAAM,GAAG,SAAS,EAAE,OAAO,MAAM,GAAG,SAAS,EAAE,UAAM;;;;CAU3G,CAAC"}
|
package/dist/lib/pagination.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ToolInputError } from "../client/errors.js";
|
|
1
2
|
import { LIMITS } from "./truncate.js";
|
|
2
3
|
export const encodeCursor = (cursor) => Buffer.from(JSON.stringify(cursor), "utf8").toString("base64url");
|
|
3
4
|
export const decodeCursor = (raw) => {
|
|
@@ -9,32 +10,36 @@ export const decodeCursor = (raw) => {
|
|
|
9
10
|
return null;
|
|
10
11
|
if (!Number.isInteger(parsed.page) || parsed.page < 1)
|
|
11
12
|
return null;
|
|
12
|
-
return { page: parsed.page, limit: clampLimit(parsed.limit) };
|
|
13
|
+
return { page: parsed.page, limit: clampLimit(parsed.limit), ...(typeof parsed.q === "string" ? { q: parsed.q } : {}) };
|
|
13
14
|
}
|
|
14
15
|
catch {
|
|
15
16
|
return null;
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
19
|
export const clampLimit = (limit) => Math.min(LIMITS.LIST_MAX, Math.max(1, Math.floor(limit ?? LIMITS.LIST_DEFAULT)));
|
|
19
|
-
export const pageFromCursor = (cursor, limit) => {
|
|
20
|
+
export const pageFromCursor = (cursor, limit, q = "") => {
|
|
21
|
+
if (!cursor)
|
|
22
|
+
return { page: 1, limit: clampLimit(limit) };
|
|
20
23
|
const decoded = decodeCursor(cursor);
|
|
21
|
-
if (decoded)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
if (!decoded)
|
|
25
|
+
throw new ToolInputError("CURSOR_INVALID", "That cursor is not one this server issued — pass the nextCursor from the previous result verbatim, or omit it for the first page.");
|
|
26
|
+
if ((decoded.q ?? "") !== q)
|
|
27
|
+
throw new ToolInputError("CURSOR_QUERY_MISMATCH", "That cursor belongs to a different query — omit it to start this query from the first page.");
|
|
28
|
+
return decoded;
|
|
24
29
|
};
|
|
25
30
|
export const nextCursorFor = (pagination) => pagination.page < pagination.totalPages
|
|
26
31
|
? encodeCursor({ page: pagination.page + 1, limit: pagination.limit })
|
|
27
32
|
: null;
|
|
28
33
|
// Client-side slice for list endpoints that are not paginated server-side.
|
|
29
|
-
export const sliceWithCursor = (items, cursor, limit) => {
|
|
30
|
-
const { page, limit: size } = pageFromCursor(cursor, limit);
|
|
34
|
+
export const sliceWithCursor = (items, cursor, limit, q = "") => {
|
|
35
|
+
const { page, limit: size } = pageFromCursor(cursor, limit, q);
|
|
31
36
|
const start = (page - 1) * size;
|
|
32
37
|
const slice = items.slice(start, start + size);
|
|
33
38
|
const totalPages = Math.max(1, Math.ceil(items.length / size));
|
|
34
39
|
return {
|
|
35
40
|
items: slice,
|
|
36
41
|
total: items.length,
|
|
37
|
-
nextCursor: page < totalPages ? encodeCursor({ page: page + 1, limit: size }) : null,
|
|
42
|
+
nextCursor: page < totalPages ? encodeCursor({ page: page + 1, limit: size, ...(q ? { q } : {}) }) : null,
|
|
38
43
|
};
|
|
39
44
|
};
|
|
40
45
|
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/lib/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/lib/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAavC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAkB,EAAU,EAAE,CACzD,MAAM,CAAC,IAAI,CAAC,I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CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/D,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,UAAU,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;KAC1G,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Redactor {
|
|
2
|
+
text(value: string): string;
|
|
3
|
+
value(value: unknown): unknown;
|
|
4
|
+
headers(headers: Record<string, unknown> | undefined): Record<string, string>;
|
|
5
|
+
query(query: Record<string, unknown> | undefined): Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface RedactorOptions {
|
|
8
|
+
secretHeaders?: Iterable<string>;
|
|
9
|
+
secretQuery?: Iterable<string>;
|
|
10
|
+
}
|
|
11
|
+
export declare const createRedactor: (knownValues: Array<[string, string]>, options?: RedactorOptions) => Redactor;
|
|
12
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/lib/redact.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IAC/B,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3E;AAED,MAAM,WAAW,eAAe;IAE9B,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,cAAc,GAAI,aAAa,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,UAAS,eAAoB,KAAG,QAsCpG,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { isSensitiveHeader, maskSecret } from "./mask.js";
|
|
2
|
+
// Run output never carries variable VALUES: every value the run held is
|
|
3
|
+
// turned back into its `{{key}}` wherever it shows up (the URL, headers, query
|
|
4
|
+
// and body as sent, the response). The model still sees WHICH variable went
|
|
5
|
+
// where — "{{baseUrl}}/users/{{userId}}" — which is what it needs to debug,
|
|
6
|
+
// and a token a login script stored is as hidden as one from the environment.
|
|
7
|
+
// Credentials that are not variables (a literal bearer token, an API key
|
|
8
|
+
// header named by the request's auth) are masked by name.
|
|
9
|
+
// Short values ("1", "yes", "GET") would shred ordinary text.
|
|
10
|
+
const MIN_VALUE_LENGTH = 4;
|
|
11
|
+
export const createRedactor = (knownValues, options = {}) => {
|
|
12
|
+
const pairs = knownValues
|
|
13
|
+
.filter(([, value]) => value.length >= MIN_VALUE_LENGTH)
|
|
14
|
+
.sort((a, b) => b[1].length - a[1].length);
|
|
15
|
+
const secretHeaders = new Set([...(options.secretHeaders ?? [])].map((name) => name.toLowerCase()));
|
|
16
|
+
const secretQuery = new Set([...(options.secretQuery ?? [])].map((name) => name.toLowerCase()));
|
|
17
|
+
const text = (input) => {
|
|
18
|
+
let out = input;
|
|
19
|
+
for (const [key, value] of pairs)
|
|
20
|
+
if (out.includes(value))
|
|
21
|
+
out = out.split(value).join(`{{${key}}}`);
|
|
22
|
+
for (const name of secretQuery) {
|
|
23
|
+
out = out.replace(new RegExp(`([?&]${name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}=)([^&#]*)`, "gi"), (_match, prefix, secret) => `${prefix}${secret.startsWith("{{") ? secret : maskSecret(secret)}`);
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
};
|
|
27
|
+
const value = (input) => {
|
|
28
|
+
if (typeof input === "string")
|
|
29
|
+
return text(input);
|
|
30
|
+
if (Array.isArray(input))
|
|
31
|
+
return input.map(value);
|
|
32
|
+
if (input && typeof input === "object") {
|
|
33
|
+
return Object.fromEntries(Object.entries(input).map(([key, child]) => [key, value(child)]));
|
|
34
|
+
}
|
|
35
|
+
return input;
|
|
36
|
+
};
|
|
37
|
+
const masked = (name, raw, secretNames) => {
|
|
38
|
+
const redacted = text(raw);
|
|
39
|
+
if (redacted !== raw)
|
|
40
|
+
return redacted; // (part of) it came from a variable
|
|
41
|
+
return (secretNames.has(name.toLowerCase()) || (secretNames === secretHeaders && isSensitiveHeader(name))) && raw ? maskSecret(raw) : redacted;
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
text,
|
|
45
|
+
value,
|
|
46
|
+
headers: (headers) => Object.fromEntries(Object.entries(headers ?? {}).map(([name, raw]) => [name, masked(name, Array.isArray(raw) ? raw.join(", ") : String(raw), secretHeaders)])),
|
|
47
|
+
query: (query) => Object.fromEntries(Object.entries(query ?? {}).map(([name, raw]) => [name, masked(name, String(raw), secretQuery)])),
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/lib/redact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE1D,wEAAwE;AACxE,+EAA+E;AAC/E,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,yEAAy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,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACjJ,CAAC,CAAC;IAEF,OAAO;QACL,IAAI;QACJ,KAAK;QACL,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CACnB,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAChK,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;KACvI,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const unknownKeysErrorMap: (noun: string, validKeys: string[], where?: string) => z.ZodErrorMap;
|
|
3
|
+
export declare const strictObject: <T extends z.ZodRawShape>(shape: T, noun: string, where?: string) => z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
4
|
+
//# sourceMappingURL=strict.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict.d.ts","sourceRoot":"","sources":["../../src/lib/strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,mBAAmB,GAC7B,MAAM,MAAM,EAAE,WAAW,MAAM,EAAE,EAAE,QAAQ,MAAM,KAAG,CAAC,CAAC,WAMpB,CAAC;AAEtC,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,4PACE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Strict objects: an unknown or misspelled key is an ERROR naming the valid
|
|
3
|
+
// keys — never silently stripped (zod's default), because a stripped key
|
|
4
|
+
// means the tool quietly does something other than what was asked
|
|
5
|
+
// (`workspaceId` instead of `workspace` → the default workspace; `strokeColor`
|
|
6
|
+
// instead of `stroke` → an unstyled node, reported as success).
|
|
7
|
+
// `noun` names one key ("style key", "argument"); `where` says whose.
|
|
8
|
+
export const unknownKeysErrorMap = (noun, validKeys, where) => (issue, ctx) => issue.code === z.ZodIssueCode.unrecognized_keys
|
|
9
|
+
? {
|
|
10
|
+
message: `Unknown ${noun}${issue.keys.length === 1 ? "" : "s"} ${issue.keys.map((key) => `"${key}"`).join(", ")}${where ? ` for ${where}` : ""}. Valid ${noun}s: ${validKeys.join(", ")}`,
|
|
11
|
+
}
|
|
12
|
+
: { message: ctx.defaultError };
|
|
13
|
+
export const strictObject = (shape, noun, where) => z.object(shape, { errorMap: unknownKeysErrorMap(noun, Object.keys(shape), where) }).strict();
|
|
14
|
+
//# sourceMappingURL=strict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict.js","sourceRoot":"","sources":["../../src/lib/strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,4EAA4E;AAC5E,yEAAyE;AACzE,kEAAkE;AAClE,+EAA+E;AAC/E,gEAAgE;AAEhE,sEAAsE;AACtE,MAAM,CAAC,MAAM,mBAAmB,GAC9B,CAAC,IAAY,EAAE,SAAmB,EAAE,KAAc,EAAiB,EAAE,CACrE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CACb,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,YAAY,CAAC,iBAAiB;IAC7C,CAAC,CAAC;QACE,OAAO,EAAE,WAAW,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,IAAI,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;KAC1L;IACH,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,CAA0B,KAAQ,EAAE,IAAY,EAAE,KAAc,EAAE,EAAE,CAC9F,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -35,7 +35,7 @@ Steps:
|
|
|
35
35
|
Steps:
|
|
36
36
|
1. Read \`callman://diagram/components\` — use ONLY those \`type\` values.
|
|
37
37
|
2. From the code and configuration (docker-compose, Kubernetes manifests, terraform, env files, package manifests) identify: services/apps, databases and caches, message brokers/queues, external APIs, auth providers, observability, cloud resources, and the boundaries they live in (VPC, cluster, namespace).
|
|
38
|
-
3. Model 8–25 nodes with 1–3 word labels. Put components inside boundaries with \`parent\`
|
|
38
|
+
3. Model 8–25 nodes with 1–3 word labels. Put components inside boundaries with \`parent\` — the boundary is a \`frame\` (or \`pool.horizontal\` / \`pool.vertical\`) node. Give each boundary its own color so zones read at a glance: \`style: { stroke: "#8B5CF6", fill: "rgba(139,92,246,0.07)", textColor: "#8B5CF6", strokeWidth: 2, bold: true }\` (see \`callman://docs/diagram-schema\` → Styling). Give each edge a meaning: \`sync\` for request/response calls, \`async\` for events/callbacks, \`bus\` for streams/queues, \`fallback\` for retries or optional paths. Short edge labels (protocol or event name) only where they add information.
|
|
39
39
|
4. Call \`create_diagram\` with \`name: "${name ?? "<system name>"}"\`, no positions (automatic layout). If it reports unknown types, fix them with the suggestions and retry.
|
|
40
40
|
5. Describe the diagram in a few sentences and tell me it is in the Callman Diagrams library (Refresh to see it). For corrections use \`patch_diagram\`, not a full rebuild.`));
|
|
41
41
|
server.registerPrompt("create_scenario_from_flow", {
|
|
@@ -49,17 +49,17 @@ Steps:
|
|
|
49
49
|
}, ({ flow, collection, workspace }) => user(`Create a Callman scenario that tests this flow${where(workspace)}: ${flow}
|
|
50
50
|
|
|
51
51
|
Steps:
|
|
52
|
-
1. Read \`callman://docs/scenario-nodes\` for the node types
|
|
53
|
-
2. Find the requests to reuse with \`search_requests\`${collection ? ` in the collection "${collection}"` : ""} and read the ones you need with \`get_request\` (
|
|
54
|
-
3. Build the graph: one \`request\` node per call; an \`assertion\` node after each important response (
|
|
55
|
-
4. Call \`create_scenario\` with \`dryRun: true\`, review the resolved
|
|
56
|
-
5. Offer to run it with \`run_scenario\` and to explain the report. On-prem:
|
|
52
|
+
1. Read \`callman://docs/scenario-nodes\` for the node types, their config fields, what is required, labels and graph rules.
|
|
53
|
+
2. Find the requests to reuse with \`search_requests\`${collection ? ` in the collection "${collection}"` : ""} and read the ones you need with \`get_request\` (reveal: true if you need the real credentials — a masked value cannot be saved). Request nodes carry their own config — copy method/url/headers/query/body/auth from the saved request (the request tools' shapes are accepted and converted) and use \`{{Label.body.path}}\` / \`{{env.KEY}}\` for values produced by earlier steps.
|
|
54
|
+
3. Build the graph: one \`request\` node per call with a unique identifier label (\`Login\`, \`CreateOrder\`); an \`assertion\` node after each important response (checks with left/operator/right); \`set-vars\` to capture ids/tokens; a \`condition\` with \`yes\`/\`no\` edges where the flow branches; \`poll\` for eventually-consistent checks; an \`end\` node last. db/redis/kafka nodes need a \`connectionId\` from \`list_connections\`. Add a scenario environment with the variables the flow needs.
|
|
55
|
+
4. Call \`create_scenario\` with \`dryRun: true\`, review the resolved nodes, then create it for real. Fix anything listed under \`warnings\` (config keys the server ignored) with \`patch_scenario\`.
|
|
56
|
+
5. Offer to run it with \`run_scenario\` and to explain the report (\`failedNodes\` has the failing checks with expected vs actual). On-prem: a personal token runs the APPROVED version — use \`submit_scenario\` and have it approved first.`));
|
|
57
57
|
server.registerPrompt("document_collection", {
|
|
58
58
|
title: "Document an API collection",
|
|
59
59
|
description: "Read a Callman collection and write API documentation (Markdown or an OpenAPI skeleton) from its requests.",
|
|
60
60
|
argsSchema: {
|
|
61
61
|
collection: z.string().describe("Collection id or name"),
|
|
62
|
-
format: z.
|
|
62
|
+
format: z.enum(["markdown", "openapi"]).optional().describe("markdown (default) or openapi"),
|
|
63
63
|
workspace: z.string().optional(),
|
|
64
64
|
},
|
|
65
65
|
}, ({ collection, format, workspace }) => user(`Document the Callman collection "${collection}"${where(workspace)} as ${format === "openapi" ? "an OpenAPI 3.1 skeleton" : "Markdown"}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,2EAA2E;AA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B,CAAC;YAC5F,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACjC;KACF,EACD,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CACpC,IAAI,CAAC,oCAAoC,UAAU,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,UAAU;;;;;kEAK/E,UAAU,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,wDAAwD,CAAC,CACrN,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/resources/docs/contracts.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,QAsEzB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { SCENARIO_CONTRACT_FORMATS } from "callman-core";
|
|
2
|
+
import { DATA_CONTRACT_LIMITS } from "../../domain/contracts.js";
|
|
3
|
+
export const CONTRACTS_DOC = `# Contract checks on a request
|
|
4
|
+
|
|
5
|
+
Two documents attached to a saved request — the desktop's Contracts tab. Every runner
|
|
6
|
+
(desktop, CLI, \`run_request\`, \`run_collection\`) evaluates them after the response and
|
|
7
|
+
reports them next to the \`pm.test\` results.
|
|
8
|
+
|
|
9
|
+
| Tool | Does |
|
|
10
|
+
|---|---|
|
|
11
|
+
| \`get_contract_checks\` | read the rules (with ids) and the data contract |
|
|
12
|
+
| \`add_contract_rules\` | add up to 200 rules at once (\`replace: true\` swaps the whole set) |
|
|
13
|
+
| \`update_contract_rule\` | change one rule's path, rules or enabled |
|
|
14
|
+
| \`delete_contract_rules\` | delete some or all rules |
|
|
15
|
+
| \`test_contract_rules\` | evaluate the enabled rules against a sample body — nothing is sent or saved |
|
|
16
|
+
| \`set_data_contract\` / \`delete_data_contract\` | replace / remove the data-driven contract |
|
|
17
|
+
|
|
18
|
+
## Field rules
|
|
19
|
+
\`{ "path": "<field path>", "rules": { … }, "enabled": true }\`
|
|
20
|
+
\`\`\`jsonc
|
|
21
|
+
{ "path": "users[].id", "rules": { "required": true, "type": "string", "format": "uuid" } }
|
|
22
|
+
{ "path": "users", "rules": { "type": "array", "minItems": 1, "unique": { "mode": "byField", "fields": ["id"] } } }
|
|
23
|
+
{ "path": "total", "rules": { "type": "number", "integer": true, "min": 0 } }
|
|
24
|
+
{ "path": "status", "rules": { "enumValues": ["NEW", "PAID", "SHIPPED"] } }
|
|
25
|
+
{ "path": "email", "rules": { "format": "email", "notEmpty": true } }
|
|
26
|
+
{ "path": "response.status", "rules": { "equals": 200 } }
|
|
27
|
+
{ "path": "response.headers.content-type", "rules": { "startsWith": "application/json" } }
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
### Paths
|
|
31
|
+
- Body fields with dots: \`user.address.city\`.
|
|
32
|
+
- \`[]\` checks EVERY element: \`users[].id\`, \`[].name\` (top-level array) — one result per element.
|
|
33
|
+
- \`[n]\` checks one element: \`items[0].price\`.
|
|
34
|
+
- \`response.status\`, \`response.headers.<lower-case name>\`, \`response.duration\` (ms) check the
|
|
35
|
+
HTTP envelope instead of the body.
|
|
36
|
+
|
|
37
|
+
### Rules (combine freely; at least one per rule)
|
|
38
|
+
| Applies to | Rules |
|
|
39
|
+
|---|---|
|
|
40
|
+
| any | \`required\`, \`type\` (string · number · boolean · object · array · null), \`equals\`, \`notEmpty\`, \`enumValues\` |
|
|
41
|
+
| numbers | \`min\`, \`max\`, \`greaterThan\`, \`lessThan\`, \`integer\`, \`positive\`, \`negative\`, \`nonZero\` |
|
|
42
|
+
| strings | \`minLength\`, \`maxLength\`, \`pattern\` (JS regex), \`contains\`, \`notContains\`, \`startsWith\`, \`endsWith\`, \`caseSensitive\` (default true), \`format\` |
|
|
43
|
+
| arrays | \`minItems\`, \`maxItems\`, \`sorted: { order: asc|desc, field? }\`, \`unique: { mode: whole|byField, fields? }\` |
|
|
44
|
+
| objects | \`requiredKeys\`, \`forbiddenKeys\`, \`minProperties\`, \`maxProperties\`, \`strictSchema\` (no keys beyond requiredKeys) |
|
|
45
|
+
|
|
46
|
+
\`format\`: ${SCENARIO_CONTRACT_FORMATS.join(", ")}.
|
|
47
|
+
|
|
48
|
+
The server also refuses contradictions: min > max, minLength > maxLength, minItems > maxItems,
|
|
49
|
+
greaterThan ≥ lessThan, a key both required and forbidden, \`unique.mode: "byField"\` without
|
|
50
|
+
fields, an invalid regex.
|
|
51
|
+
|
|
52
|
+
## Data-driven contract
|
|
53
|
+
The request runs ONCE PER ROW; the row's values are \`{{data.<column>}}\` and each row checks its
|
|
54
|
+
own expected status and field assertions (same rules as above).
|
|
55
|
+
\`\`\`jsonc
|
|
56
|
+
{
|
|
57
|
+
"columns": ["userId", "expected"],
|
|
58
|
+
"rows": [
|
|
59
|
+
{ "data": { "userId": "1", "expected": "Ann" }, "expectedStatus": 200,
|
|
60
|
+
"assertions": [{ "path": "name", "rules": { "equals": "Ann" } }] },
|
|
61
|
+
{ "data": { "userId": "404", "expected": "" }, "expectedStatus": 404 }
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
\`\`\`
|
|
65
|
+
Put the \`{{data.<column>}}\` tokens into the request (url, query, headers, body) with
|
|
66
|
+
\`update_request\` — \`set_data_contract\` warns about columns the request does not use yet.
|
|
67
|
+
Limits: ${DATA_CONTRACT_LIMITS.columns} columns, ${DATA_CONTRACT_LIMITS.rows} rows, ${DATA_CONTRACT_LIMITS.assertions} assertions per row, ${DATA_CONTRACT_LIMITS.cell} characters per cell.
|
|
68
|
+
|
|
69
|
+
## Contract checks vs pm.test
|
|
70
|
+
Use contract rules for the SHAPE of a response (types, formats, required fields, ranges) —
|
|
71
|
+
declarative, shown per field in reports. Use \`pm.test\` in \`postResponseScript\` for logic that
|
|
72
|
+
needs code (cross-field checks, saving values with \`pm.environment.set\`).
|
|
73
|
+
`;
|
|
74
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/resources/docs/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2Cf,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;UAqBxC,oBAAoB,CAAC,OAAO,aAAa,oBAAoB,CAAC,IAAI,UAAU,oBAAoB,CAAC,UAAU,wBAAwB,oBAAoB,CAAC,IAAI;;;;;;CAMrK,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.\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\": \"
|
|
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\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\": \"n6\", \"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```\n- updateNode `changes` accepts: type, label, parent (null/\"\" = top level), position, size,\n style, rotation, locked, hidden, data. `style` and `data` MERGE into what the node has;\n a key set to null is removed.\n- updateEdge `changes` accepts: source, target, label (\"\" removes it), semantic, color,\n routing, markerEnd, markerStart.\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 \u2014 so read it before a patch.\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 };\n canvas?: { background?: \"grid\" | \"dots\" | \"blank\"; gridSize?: number };\n nodes: { id; type; position: {x,y}; size: {width,height}; label?; parentId?; rotation?;\n locked?; hidden?; style?: DiagramStyle; data? }[];\n edges: { id; source?; target?; label?; routing?; style?: DiagramStyle; markerStart?; markerEnd?;\n waypoints?; sourceAnchor?; targetAnchor? }[];\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,oyPAkI9B,CAAC"}
|
|
@@ -3,6 +3,8 @@ export const DIAGRAM_SCHEMA_DOC = `# Diagrams (create_diagram, update_diagram, p
|
|
|
3
3
|
A diagram is a **DiagramDocument** (schemaVersion 1): typed nodes with positions and sizes,
|
|
4
4
|
edges between nodes, a title. You write the compact form below; the server assigns ids,
|
|
5
5
|
sizes from the component catalog, edge styles from the semantic, and lays the nodes out.
|
|
6
|
+
Every object is strict: a misspelled or unknown key is an error that names the valid keys,
|
|
7
|
+
never silently dropped.
|
|
6
8
|
|
|
7
9
|
## Compact input
|
|
8
10
|
\`\`\`jsonc
|
|
@@ -10,44 +12,105 @@ sizes from the component catalog, edge styles from the semantic, and lays the no
|
|
|
10
12
|
"name": "Order platform", // library entry name
|
|
11
13
|
"title": "Order platform — runtime view",
|
|
12
14
|
"nodes": [
|
|
13
|
-
{ "id": "
|
|
14
|
-
|
|
15
|
-
{ "id": "
|
|
16
|
-
{ "id": "
|
|
17
|
-
{ "id": "
|
|
15
|
+
{ "id": "k8s", "type": "frame", "label": "Kubernetes", // a container
|
|
16
|
+
"style": { "stroke": "#8B5CF6", "fill": "rgba(139,92,246,0.07)", "textColor": "#8B5CF6", "strokeWidth": 2, "bold": true } },
|
|
17
|
+
{ "id": "gw", "type": "net.api-gateway", "label": "API Gateway" },
|
|
18
|
+
{ "id": "orders","type": "net.service", "label": "Orders service", "parent": "k8s" },
|
|
19
|
+
{ "id": "db", "type": "db.postgres", "label": "orders db" },
|
|
20
|
+
{ "id": "bus", "type": "mq.kafka", "label": "events" }
|
|
18
21
|
],
|
|
19
22
|
"edges": [
|
|
20
23
|
{ "source": "gw", "target": "orders", "label": "REST", "semantic": "sync" },
|
|
21
|
-
{ "source": "orders", "target": "db", "semantic": "sync" },
|
|
24
|
+
{ "source": "orders", "target": "db", "semantic": "sync", "color": "#10B981" },
|
|
22
25
|
{ "source": "orders", "target": "bus", "label": "OrderCreated" } // → bus automatically
|
|
23
26
|
]
|
|
24
27
|
}
|
|
25
28
|
\`\`\`
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
## Nodes
|
|
31
|
+
| Field | Type | Notes |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| \`id\` | string | Stable id you reference from \`parent\` and edges; generated (n1, n2…) when omitted |
|
|
34
|
+
| \`type\` | string | MUST be a catalog type — \`callman://diagram/components\` (or one category: \`callman://diagram/components/aws\`). Unknown types are rejected with suggestions; \`strictTypes: false\` draws them as rectangles |
|
|
35
|
+
| \`label\` | string | 1–3 words reads best |
|
|
36
|
+
| \`parent\` | node id | Puts the node inside a container: \`frame\`, \`pool.horizontal\` or \`pool.vertical\` |
|
|
37
|
+
| \`position\` | {x, y} | Top-left, relative to the parent container. Omit to auto-layout |
|
|
38
|
+
| \`size\` | {width, height} | Defaults to the catalog size |
|
|
39
|
+
| \`style\` | object | See **Styling** |
|
|
40
|
+
| \`rotation\` | number | Degrees, clockwise |
|
|
41
|
+
| \`locked\` / \`hidden\` | boolean | Locked nodes cannot be moved in the studio |
|
|
42
|
+
| \`data\` | object | Free-form metadata kept with the node; not rendered |
|
|
43
|
+
|
|
44
|
+
\`line\`, \`arrow\` and \`line.dashed\` are connectors in the studio's palette, not nodes — draw
|
|
45
|
+
connections as edges.
|
|
46
|
+
|
|
47
|
+
## Edges
|
|
48
|
+
| Field | Type | Notes |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| \`source\`, \`target\` | node id | A container id is allowed |
|
|
51
|
+
| \`label\` | string | |
|
|
52
|
+
| \`semantic\` | sync · async · fallback · bus | \`sync\` solid (request/response, default), \`async\` dashed (event, callback), \`fallback\` dotted (retry / optional path), \`bus\` heavy (message bus / stream — automatic when an end is a messaging component) |
|
|
53
|
+
| \`color\` | CSS color | Line color, independent of the semantic |
|
|
54
|
+
| \`routing\` | orthogonal · straight · curved | Default orthogonal (auto-routed right angles) |
|
|
55
|
+
| \`markerEnd\` / \`markerStart\` | none · classic · classicThin · open · block · diamond · oval | Default: classicThin at the target, none at the source. Set \`markerStart\` for a two-way line |
|
|
56
|
+
|
|
57
|
+
The semantic owns the line pattern and width; there is no separate dash or width field on edges.
|
|
58
|
+
|
|
59
|
+
## Styling (node \`style\`)
|
|
60
|
+
| Key | Type | Notes |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| \`fill\` | CSS color | Background. A translucent \`rgba(r,g,b,0.07)\` tints a container without hiding its children |
|
|
63
|
+
| \`stroke\` | CSS color | Border |
|
|
64
|
+
| \`textColor\` | CSS color | Label |
|
|
65
|
+
| \`strokeWidth\` | number (px) | Border width |
|
|
66
|
+
| \`dashed\` | boolean | Containers (frame) are dashed by default |
|
|
67
|
+
| \`dashPattern\` | string | SVG dash array when dashed: \`"6 4"\` dashed, \`"1 3"\` dotted |
|
|
68
|
+
| \`radius\` | number (px) | Corner radius (\`rounded: true\` for the default radius) |
|
|
69
|
+
| \`fontSize\` | number (px) | |
|
|
70
|
+
| \`fontFamily\` | string | |
|
|
71
|
+
| \`bold\`, \`italic\`, \`underline\` | boolean | |
|
|
72
|
+
| \`align\` | left · center · right | |
|
|
73
|
+
| \`verticalAlign\` | top · middle · bottom | |
|
|
74
|
+
| \`shadow\` | boolean | |
|
|
75
|
+
| \`opacity\` | 0–100 | |
|
|
76
|
+
|
|
77
|
+
Colors are CSS strings — \`"#3B82F6"\`, \`"rgb(59,130,246)"\`, \`"rgba(59,130,246,0.08)"\`, \`"tomato"\`.
|
|
78
|
+
Pick mid-tone colors: the studio has light and dark themes.
|
|
79
|
+
|
|
80
|
+
Color-coding containers is the quickest way to make zones read at a glance:
|
|
81
|
+
\`\`\`jsonc
|
|
82
|
+
{ "op": "updateNode", "id": "k8s", "changes": { "style": { "stroke": "#8B5CF6", "fill": "rgba(139,92,246,0.07)", "textColor": "#8B5CF6", "strokeWidth": 2, "bold": true } } }
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
## Layout
|
|
86
|
+
Positions are optional; when any node lacks one the whole diagram is laid out
|
|
87
|
+
(\`direction\`: DOWN, RIGHT, UP, LEFT). Give explicit \`position: {x,y}\` only when the user
|
|
88
|
+
asks for a specific arrangement. Keep diagrams readable: 8–25 nodes, short labels, one edge
|
|
89
|
+
per relationship.
|
|
39
90
|
|
|
40
91
|
## Editing: patch_diagram ops
|
|
41
92
|
\`\`\`jsonc
|
|
42
|
-
{ "op": "addNode", "node": { "type": "db.redis", "label": "cache" } }
|
|
43
|
-
{ "op": "updateNode", "id": "orders", "changes": { "label": "Orders API" } }
|
|
44
|
-
{ "op": "
|
|
45
|
-
{ "op": "
|
|
46
|
-
{ "op": "
|
|
93
|
+
{ "op": "addNode", "node": { "type": "db.redis", "label": "cache", "parent": "k8s" } }
|
|
94
|
+
{ "op": "updateNode", "id": "orders", "changes": { "label": "Orders API", "style": { "fill": "#EFF6FF" } } }
|
|
95
|
+
{ "op": "updateNode", "id": "orders", "changes": { "style": { "fill": null } } } // remove one style key
|
|
96
|
+
{ "op": "updateNode", "id": "orders", "changes": { "style": null } } // clear the style
|
|
97
|
+
{ "op": "removeNode", "id": "bus" } // its edges are removed, its children move to the top level
|
|
98
|
+
{ "op": "addEdge", "edge": { "source": "orders", "target": "n6", "semantic": "async", "color": "#F59E0B" } }
|
|
99
|
+
{ "op": "updateEdge", "id": "e2", "changes": { "label": "gRPC", "semantic": "fallback" } } // color is kept
|
|
100
|
+
{ "op": "updateEdge", "id": "e2", "changes": { "color": null } } // back to the default color
|
|
47
101
|
{ "op": "removeEdge", "id": "e3" }
|
|
48
102
|
{ "op": "setTitle", "title": "New title" }
|
|
49
103
|
\`\`\`
|
|
50
|
-
|
|
104
|
+
- updateNode \`changes\` accepts: type, label, parent (null/"" = top level), position, size,
|
|
105
|
+
style, rotation, locked, hidden, data. \`style\` and \`data\` MERGE into what the node has;
|
|
106
|
+
a key set to null is removed.
|
|
107
|
+
- updateEdge \`changes\` accepts: source, target, label ("" removes it), semantic, color,
|
|
108
|
+
routing, markerEnd, markerStart.
|
|
109
|
+
- Moving a node (position, size or parent) or re-pointing an edge drops the saved route of
|
|
110
|
+
the edges involved; the studio re-routes them (\`reroutedEdges\` in the result).
|
|
111
|
+
- \`relayout\`: \`new\` (default — only new nodes get a place), \`all\` (re-run layout), \`none\`.
|
|
112
|
+
- \`get_diagram\` (view \`graph\`) returns nodes and edges in this same shape — ids, parents,
|
|
113
|
+
styles, colors — so read it before a patch.
|
|
51
114
|
|
|
52
115
|
## Stored document (get_diagram view: "full")
|
|
53
116
|
\`\`\`ts
|
|
@@ -55,11 +118,15 @@ interface DiagramDocument {
|
|
|
55
118
|
schemaVersion: 1; id: string;
|
|
56
119
|
meta: { title: string; createdAt: string; updatedAt: string };
|
|
57
120
|
canvas?: { background?: "grid" | "dots" | "blank"; gridSize?: number };
|
|
58
|
-
nodes: { id; type; position: {x,y}; size: {width,height}; label?; parentId?;
|
|
59
|
-
|
|
121
|
+
nodes: { id; type; position: {x,y}; size: {width,height}; label?; parentId?; rotation?;
|
|
122
|
+
locked?; hidden?; style?: DiagramStyle; data? }[];
|
|
123
|
+
edges: { id; source?; target?; label?; routing?; style?: DiagramStyle; markerStart?; markerEnd?;
|
|
124
|
+
waypoints?; sourceAnchor?; targetAnchor? }[];
|
|
60
125
|
}
|
|
126
|
+
// Stored colors are { raw: "#3B82F6" } (or a theme { token }); bold/italic/underline are
|
|
127
|
+
// the bitmask fontStyle (1 | 2 | 4). The tools convert both ways — write plain colors.
|
|
61
128
|
\`\`\`
|
|
62
|
-
Edge meaning is derived from \`style\` (dashed + dashPattern + strokeWidth) —
|
|
63
|
-
|
|
129
|
+
Edge meaning is derived from \`style\` (dashed + dashPattern + strokeWidth) — set it with
|
|
130
|
+
\`semantic\`, never directly.
|
|
64
131
|
`;
|
|
65
132
|
//# sourceMappingURL=diagramSchema.js.map
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkIjC,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 server exposes it to you through\ntools; 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
|
|
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 server exposes it to you through\ntools; 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, 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## 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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/resources/docs/overview.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/resources/docs/overview.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,8mIAkExB,CAAC"}
|