@warmio/contracts 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +15 -0
  2. package/dist/api/endpoints.d.ts +461 -0
  3. package/dist/api/endpoints.d.ts.map +1 -0
  4. package/dist/api/endpoints.js +397 -0
  5. package/dist/api/endpoints.js.map +1 -0
  6. package/dist/api/index.d.ts +2 -0
  7. package/dist/api/index.d.ts.map +1 -0
  8. package/dist/api/index.js +2 -0
  9. package/dist/api/index.js.map +1 -0
  10. package/dist/examples/automation.d.ts +16 -0
  11. package/dist/examples/automation.d.ts.map +1 -0
  12. package/dist/examples/automation.js +17 -0
  13. package/dist/examples/automation.js.map +1 -0
  14. package/dist/examples/financial-context.d.ts +32 -0
  15. package/dist/examples/financial-context.d.ts.map +1 -0
  16. package/dist/examples/financial-context.js +29 -0
  17. package/dist/examples/financial-context.js.map +1 -0
  18. package/dist/examples/index.d.ts +3 -0
  19. package/dist/examples/index.d.ts.map +1 -0
  20. package/dist/examples/index.js +3 -0
  21. package/dist/examples/index.js.map +1 -0
  22. package/dist/generated/base-openapi.d.ts +2 -0
  23. package/dist/generated/base-openapi.d.ts.map +1 -0
  24. package/dist/generated/base-openapi.js +3 -0
  25. package/dist/generated/base-openapi.js.map +1 -0
  26. package/dist/generated/private-mcp-tool-descriptors.d.ts +1031 -0
  27. package/dist/generated/private-mcp-tool-descriptors.d.ts.map +1 -0
  28. package/dist/generated/private-mcp-tool-descriptors.js +1541 -0
  29. package/dist/generated/private-mcp-tool-descriptors.js.map +1 -0
  30. package/dist/index.d.ts +6 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +6 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/manifest.d.ts +3 -0
  35. package/dist/manifest.d.ts.map +1 -0
  36. package/dist/manifest.js +3 -0
  37. package/dist/manifest.js.map +1 -0
  38. package/dist/mcp/index.d.ts +2 -0
  39. package/dist/mcp/index.d.ts.map +1 -0
  40. package/dist/mcp/index.js +2 -0
  41. package/dist/mcp/index.js.map +1 -0
  42. package/dist/mcp/tools.d.ts +88 -0
  43. package/dist/mcp/tools.d.ts.map +1 -0
  44. package/dist/mcp/tools.js +124 -0
  45. package/dist/mcp/tools.js.map +1 -0
  46. package/dist/openapi/base.yaml +1679 -0
  47. package/dist/openapi/build-openapi.d.ts +28 -0
  48. package/dist/openapi/build-openapi.d.ts.map +1 -0
  49. package/dist/openapi/build-openapi.js +89 -0
  50. package/dist/openapi/build-openapi.js.map +1 -0
  51. package/dist/openapi/index.d.ts +2 -0
  52. package/dist/openapi/index.d.ts.map +1 -0
  53. package/dist/openapi/index.js +2 -0
  54. package/dist/openapi/index.js.map +1 -0
  55. package/dist/schemas/automation.d.ts +248 -0
  56. package/dist/schemas/automation.d.ts.map +1 -0
  57. package/dist/schemas/automation.js +46 -0
  58. package/dist/schemas/automation.js.map +1 -0
  59. package/dist/schemas/common.d.ts +76 -0
  60. package/dist/schemas/common.d.ts.map +1 -0
  61. package/dist/schemas/common.js +23 -0
  62. package/dist/schemas/common.js.map +1 -0
  63. package/dist/schemas/financial-context.d.ts +1300 -0
  64. package/dist/schemas/financial-context.d.ts.map +1 -0
  65. package/dist/schemas/financial-context.js +271 -0
  66. package/dist/schemas/financial-context.js.map +1 -0
  67. package/dist/schemas/index.d.ts +4 -0
  68. package/dist/schemas/index.d.ts.map +1 -0
  69. package/dist/schemas/index.js +4 -0
  70. package/dist/schemas/index.js.map +1 -0
  71. package/dist/types.d.ts +68 -0
  72. package/dist/types.d.ts.map +1 -0
  73. package/dist/types.js +2 -0
  74. package/dist/types.js.map +1 -0
  75. package/package.json +94 -0
@@ -0,0 +1,28 @@
1
+ type OpenApiOperation = {
2
+ operationId?: string;
3
+ security?: Array<Record<string, never[]>>;
4
+ summary?: string;
5
+ };
6
+ type OpenApiDocument = {
7
+ components?: {
8
+ schemas?: Record<string, unknown>;
9
+ securitySchemes?: Record<string, unknown>;
10
+ };
11
+ info?: {
12
+ description?: string;
13
+ };
14
+ paths?: Record<string, Record<string, OpenApiOperation>>;
15
+ servers?: Array<{
16
+ description?: string;
17
+ url?: string;
18
+ }>;
19
+ };
20
+ /**
21
+ * The rich hand-authored v2 document is package-owned in base.yaml. This builder
22
+ * preserves its prose and protocol details while replacing canonical wire shapes
23
+ * and endpoint identities from the manifest and Zod contracts.
24
+ */
25
+ export declare function buildOpenApiDocument(): OpenApiDocument;
26
+ export declare function buildOpenApiYaml(): string;
27
+ export {};
28
+ //# sourceMappingURL=build-openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-openapi.d.ts","sourceRoot":"","sources":["../../src/openapi/build-openapi.ts"],"names":[],"mappings":"AA4BA,KAAK,gBAAgB,GAAG;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,KAAK,eAAe,GAAG;IACrB,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC3C,CAAC;IACF,IAAI,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACzD,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzD,CAAC;AAUF;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,CAyEtD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
@@ -0,0 +1,89 @@
1
+ import { zodToJsonSchema } from 'zod-to-json-schema';
2
+ import { parse, stringify } from 'yaml';
3
+ import { apiAuthSchemes, apiEndpointManifest, apiRateLimits, API_ORIGIN } from '../api/index.js';
4
+ import { baseOpenApiYaml } from '../generated/base-openapi.js';
5
+ import { automationInputSchema, automationInvocationResponseSchema, automationOperationSchema, describeOperationRequestSchema, financialContextMetaSchema, financialContextAccountSchema, financialContextBudgetSchema, financialContextGoalSchema, financialContextHealthSchema, financialContextHoldingSchema, financialContextLiabilitySchema, financialContextPositionSchema, financialContextRecurringSchema, financialContextSchema, financialContextSnapshotSchema, financialContextStatusSchema, financialContextTransactionIndexSchema, financialContextTransactionSchema, invokeOperationRequestSchema, latestTransactionsSchema, transactionMonthSchema, } from '../schemas/index.js';
6
+ function cloneBaseDocument() {
7
+ return parse(baseOpenApiYaml);
8
+ }
9
+ function schema(value) {
10
+ return zodToJsonSchema(value, { $refStrategy: 'none' });
11
+ }
12
+ /**
13
+ * The rich hand-authored v2 document is package-owned in base.yaml. This builder
14
+ * preserves its prose and protocol details while replacing canonical wire shapes
15
+ * and endpoint identities from the manifest and Zod contracts.
16
+ */
17
+ export function buildOpenApiDocument() {
18
+ const document = cloneBaseDocument();
19
+ if (!document.info ||
20
+ !document.paths ||
21
+ !document.servers?.[0] ||
22
+ !document.components?.schemas ||
23
+ !document.components.securitySchemes) {
24
+ throw new Error('The OpenAPI base document is missing paths, schemas, or a production server.');
25
+ }
26
+ document.info.description = `Read your financial context or invoke supported Warm actions through a compact operation catalog.
27
+
28
+ ## Authentication
29
+ All requests use \`Authorization: Bearer\`. ${apiAuthSchemes.context.description}
30
+ ${apiAuthSchemes.automation.description} Automation keys begin with \`${apiAuthSchemes.automation.bearer_prefix}\`.
31
+
32
+ ## Rate Limits
33
+ - Context keys: ${apiRateLimits.context.requests_per_hour} requests per hour per key
34
+ - Automation keys: ${apiRateLimits.automation.requests_per_hour} requests per hour per key
35
+ - Rate limit headers are included in authenticated responses.
36
+ - \`/api/export\` supports dataset-scoped delta sync with \`since\` and publishes edge-cache metadata headers.`;
37
+ document.servers[0].url = API_ORIGIN;
38
+ document.components.securitySchemes = {
39
+ AutomationKeyAuth: {
40
+ description: `Automation format: Authorization: Bearer ${apiAuthSchemes.automation.bearer_prefix}...`,
41
+ scheme: apiAuthSchemes.automation.scheme,
42
+ type: 'http',
43
+ },
44
+ BearerAuth: {
45
+ description: apiAuthSchemes.context.description,
46
+ scheme: apiAuthSchemes.context.scheme,
47
+ type: 'http',
48
+ },
49
+ };
50
+ for (const endpoint of apiEndpointManifest) {
51
+ const operation = document.paths[endpoint.path]?.[endpoint.method.toLowerCase()];
52
+ if (!operation) {
53
+ throw new Error(`The OpenAPI base document is missing ${endpoint.method} ${endpoint.path}.`);
54
+ }
55
+ operation.operationId = endpoint.operation_id;
56
+ operation.security = [
57
+ endpoint.audience === 'automation' ? { AutomationKeyAuth: [] } : { BearerAuth: [] },
58
+ ];
59
+ operation.summary = endpoint.summary;
60
+ }
61
+ Object.assign(document.components.schemas, {
62
+ AutomationInvocationResponse: schema(automationInvocationResponseSchema),
63
+ AutomationOperation: schema(automationOperationSchema),
64
+ FinancialContext: schema(financialContextSchema),
65
+ FinancialContextAccount: schema(financialContextAccountSchema),
66
+ FinancialContextBudget: schema(financialContextBudgetSchema),
67
+ FinancialContextGoal: schema(financialContextGoalSchema),
68
+ FinancialContextHealth: schema(financialContextHealthSchema),
69
+ FinancialContextHolding: schema(financialContextHoldingSchema),
70
+ FinancialContextLiability: schema(financialContextLiabilitySchema),
71
+ FinancialContextMeta: schema(financialContextMetaSchema),
72
+ FinancialContextPosition: schema(financialContextPositionSchema),
73
+ FinancialContextRecurring: schema(financialContextRecurringSchema),
74
+ FinancialContextSnapshot: schema(financialContextSnapshotSchema),
75
+ FinancialContextStatus: schema(financialContextStatusSchema),
76
+ FinancialContextTransaction: schema(financialContextTransactionSchema),
77
+ LatestTransactions: schema(latestTransactionsSchema),
78
+ OperationInput: schema(automationInputSchema),
79
+ OperationInvokeRequest: schema(invokeOperationRequestSchema),
80
+ OperationRequest: schema(describeOperationRequestSchema),
81
+ TransactionMonth: schema(transactionMonthSchema),
82
+ TransactionIndex: schema(financialContextTransactionIndexSchema),
83
+ });
84
+ return document;
85
+ }
86
+ export function buildOpenApiYaml() {
87
+ return stringify(buildOpenApiDocument(), { lineWidth: 0 });
88
+ }
89
+ //# sourceMappingURL=build-openapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-openapi.js","sourceRoot":"","sources":["../../src/openapi/build-openapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EACL,qBAAqB,EACrB,kCAAkC,EAClC,yBAAyB,EACzB,8BAA8B,EAC9B,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACtB,8BAA8B,EAC9B,4BAA4B,EAC5B,sCAAsC,EACtC,iCAAiC,EACjC,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAiB7B,SAAS,iBAAiB;IACxB,OAAO,KAAK,CAAC,eAAe,CAAoB,CAAC;AACnD,CAAC;AAED,SAAS,MAAM,CAAC,KAA4C;IAC1D,OAAO,eAAe,CAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAA4B,CAAC;AACrF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oB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AAC,wBAAwB,CAAC;QACpD,cAAc,EAAE,MAAM,CAAC,qBAAqB,CAAC;QAC7C,sBAAsB,EAAE,MAAM,CAAC,4BAA4B,CAAC;QAC5D,gBAAgB,EAAE,MAAM,CAAC,8BAA8B,CAAC;QACxD,gBAAgB,EAAE,MAAM,CAAC,sBAAsB,CAAC;QAChD,gBAAgB,EAAE,MAAM,CAAC,sCAAsC,CAAC;KACjE,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,SAAS,CAAC,oBAAoB,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './build-openapi.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openapi/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './build-openapi.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openapi/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,248 @@
1
+ import { z } from 'zod';
2
+ export declare const automationOperationDescriptorSchema: z.ZodObject<{
3
+ confirmation_required: z.ZodBoolean;
4
+ description: z.ZodString;
5
+ method: z.ZodEnum<["DELETE", "GET", "PATCH", "POST", "PUT"]>;
6
+ operation_id: z.ZodString;
7
+ path: z.ZodString;
8
+ path_parameter_kind: z.ZodNullable<z.ZodEnum<["opaque", "uuid"]>>;
9
+ risk: z.ZodArray<z.ZodEnum<["read", "write", "destructive", "external_effect"]>, "many">;
10
+ summary: z.ZodString;
11
+ }, "strict", z.ZodTypeAny, {
12
+ confirmation_required: boolean;
13
+ description: string;
14
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
15
+ operation_id: string;
16
+ path: string;
17
+ path_parameter_kind: "opaque" | "uuid" | null;
18
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
19
+ summary: string;
20
+ }, {
21
+ confirmation_required: boolean;
22
+ description: string;
23
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
24
+ operation_id: string;
25
+ path: string;
26
+ path_parameter_kind: "opaque" | "uuid" | null;
27
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
28
+ summary: string;
29
+ }>;
30
+ export declare const automationOperationSchema: z.ZodObject<Omit<{
31
+ confirmation_required: z.ZodBoolean;
32
+ description: z.ZodString;
33
+ method: z.ZodEnum<["DELETE", "GET", "PATCH", "POST", "PUT"]>;
34
+ operation_id: z.ZodString;
35
+ path: z.ZodString;
36
+ path_parameter_kind: z.ZodNullable<z.ZodEnum<["opaque", "uuid"]>>;
37
+ risk: z.ZodArray<z.ZodEnum<["read", "write", "destructive", "external_effect"]>, "many">;
38
+ summary: z.ZodString;
39
+ }, "path_parameter_kind">, "strict", z.ZodTypeAny, {
40
+ confirmation_required: boolean;
41
+ description: string;
42
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
43
+ operation_id: string;
44
+ path: string;
45
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
46
+ summary: string;
47
+ }, {
48
+ confirmation_required: boolean;
49
+ description: string;
50
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
51
+ operation_id: string;
52
+ path: string;
53
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
54
+ summary: string;
55
+ }>;
56
+ export declare const automationOperationDescriptionSchema: z.ZodObject<Omit<{
57
+ confirmation_required: z.ZodBoolean;
58
+ description: z.ZodString;
59
+ method: z.ZodEnum<["DELETE", "GET", "PATCH", "POST", "PUT"]>;
60
+ operation_id: z.ZodString;
61
+ path: z.ZodString;
62
+ path_parameter_kind: z.ZodNullable<z.ZodEnum<["opaque", "uuid"]>>;
63
+ risk: z.ZodArray<z.ZodEnum<["read", "write", "destructive", "external_effect"]>, "many">;
64
+ summary: z.ZodString;
65
+ }, "path_parameter_kind"> & {
66
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
67
+ }, "strict", z.ZodTypeAny, {
68
+ confirmation_required: boolean;
69
+ description: string;
70
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
71
+ operation_id: string;
72
+ path: string;
73
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
74
+ summary: string;
75
+ input_schema: Record<string, unknown>;
76
+ }, {
77
+ confirmation_required: boolean;
78
+ description: string;
79
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
80
+ operation_id: string;
81
+ path: string;
82
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
83
+ summary: string;
84
+ input_schema: Record<string, unknown>;
85
+ }>;
86
+ export declare const automationApprovalSchema: z.ZodObject<{
87
+ approval_url: z.ZodString;
88
+ expires_at: z.ZodString;
89
+ id: z.ZodString;
90
+ status: z.ZodLiteral<"pending">;
91
+ }, "strict", z.ZodTypeAny, {
92
+ approval_url: string;
93
+ expires_at: string;
94
+ id: string;
95
+ status: "pending";
96
+ }, {
97
+ approval_url: string;
98
+ expires_at: string;
99
+ id: string;
100
+ status: "pending";
101
+ }>;
102
+ export declare const automationOperationSearchResponseSchema: z.ZodObject<{
103
+ operations: z.ZodArray<z.ZodObject<Omit<{
104
+ confirmation_required: z.ZodBoolean;
105
+ description: z.ZodString;
106
+ method: z.ZodEnum<["DELETE", "GET", "PATCH", "POST", "PUT"]>;
107
+ operation_id: z.ZodString;
108
+ path: z.ZodString;
109
+ path_parameter_kind: z.ZodNullable<z.ZodEnum<["opaque", "uuid"]>>;
110
+ risk: z.ZodArray<z.ZodEnum<["read", "write", "destructive", "external_effect"]>, "many">;
111
+ summary: z.ZodString;
112
+ }, "path_parameter_kind">, "strict", z.ZodTypeAny, {
113
+ confirmation_required: boolean;
114
+ description: string;
115
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
116
+ operation_id: string;
117
+ path: string;
118
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
119
+ summary: string;
120
+ }, {
121
+ confirmation_required: boolean;
122
+ description: string;
123
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
124
+ operation_id: string;
125
+ path: string;
126
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
127
+ summary: string;
128
+ }>, "many">;
129
+ }, "strict", z.ZodTypeAny, {
130
+ operations: {
131
+ confirmation_required: boolean;
132
+ description: string;
133
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
134
+ operation_id: string;
135
+ path: string;
136
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
137
+ summary: string;
138
+ }[];
139
+ }, {
140
+ operations: {
141
+ confirmation_required: boolean;
142
+ description: string;
143
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
144
+ operation_id: string;
145
+ path: string;
146
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
147
+ summary: string;
148
+ }[];
149
+ }>;
150
+ export declare const automationOperationDescriptionResponseSchema: z.ZodObject<{
151
+ approval: z.ZodOptional<z.ZodObject<{
152
+ approval_url: z.ZodString;
153
+ expires_at: z.ZodString;
154
+ id: z.ZodString;
155
+ status: z.ZodLiteral<"pending">;
156
+ }, "strict", z.ZodTypeAny, {
157
+ approval_url: string;
158
+ expires_at: string;
159
+ id: string;
160
+ status: "pending";
161
+ }, {
162
+ approval_url: string;
163
+ expires_at: string;
164
+ id: string;
165
+ status: "pending";
166
+ }>>;
167
+ operation: z.ZodObject<Omit<{
168
+ confirmation_required: z.ZodBoolean;
169
+ description: z.ZodString;
170
+ method: z.ZodEnum<["DELETE", "GET", "PATCH", "POST", "PUT"]>;
171
+ operation_id: z.ZodString;
172
+ path: z.ZodString;
173
+ path_parameter_kind: z.ZodNullable<z.ZodEnum<["opaque", "uuid"]>>;
174
+ risk: z.ZodArray<z.ZodEnum<["read", "write", "destructive", "external_effect"]>, "many">;
175
+ summary: z.ZodString;
176
+ }, "path_parameter_kind"> & {
177
+ input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
178
+ }, "strict", z.ZodTypeAny, {
179
+ confirmation_required: boolean;
180
+ description: string;
181
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
182
+ operation_id: string;
183
+ path: string;
184
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
185
+ summary: string;
186
+ input_schema: Record<string, unknown>;
187
+ }, {
188
+ confirmation_required: boolean;
189
+ description: string;
190
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
191
+ operation_id: string;
192
+ path: string;
193
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
194
+ summary: string;
195
+ input_schema: Record<string, unknown>;
196
+ }>;
197
+ }, "strict", z.ZodTypeAny, {
198
+ approval?: {
199
+ approval_url: string;
200
+ expires_at: string;
201
+ id: string;
202
+ status: "pending";
203
+ } | undefined;
204
+ operation: {
205
+ confirmation_required: boolean;
206
+ description: string;
207
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
208
+ operation_id: string;
209
+ path: string;
210
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
211
+ summary: string;
212
+ input_schema: Record<string, unknown>;
213
+ };
214
+ }, {
215
+ approval?: {
216
+ approval_url: string;
217
+ expires_at: string;
218
+ id: string;
219
+ status: "pending";
220
+ } | undefined;
221
+ operation: {
222
+ confirmation_required: boolean;
223
+ description: string;
224
+ method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
225
+ operation_id: string;
226
+ path: string;
227
+ risk: ("destructive" | "external_effect" | "read" | "write")[];
228
+ summary: string;
229
+ input_schema: Record<string, unknown>;
230
+ };
231
+ }>;
232
+ export declare const automationInvocationResponseSchema: z.ZodObject<{
233
+ body: z.ZodUnknown;
234
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
235
+ operation_id: z.ZodString;
236
+ status: z.ZodNumber;
237
+ }, "strict", z.ZodTypeAny, {
238
+ body?: unknown;
239
+ headers: Record<string, string>;
240
+ operation_id: string;
241
+ status: number;
242
+ }, {
243
+ body?: unknown;
244
+ headers: Record<string, string>;
245
+ operation_id: string;
246
+ status: number;
247
+ }>;
248
+ //# sourceMappingURL=automation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automation.d.ts","sourceRoot":"","sources":["../../src/schemas/automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrC,CAAC;AAEZ,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;EAE3B,CAAC;AAEZ,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtC,CAAC;AAEZ,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;EAO1B,CAAC;AAEZ,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEzC,CAAC;AAEZ,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9C,CAAC;AAEZ,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;EAOpC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import { apiMethodSchema, apiOperationRiskSchema, pathParameterKindSchema } from './common.js';
3
+ export const automationOperationDescriptorSchema = z
4
+ .object({
5
+ confirmation_required: z.boolean(),
6
+ description: z.string(),
7
+ method: apiMethodSchema,
8
+ operation_id: z.string(),
9
+ path: z.string(),
10
+ path_parameter_kind: pathParameterKindSchema.nullable(),
11
+ risk: z.array(apiOperationRiskSchema),
12
+ summary: z.string(),
13
+ })
14
+ .strict();
15
+ export const automationOperationSchema = automationOperationDescriptorSchema
16
+ .omit({ path_parameter_kind: true })
17
+ .strict();
18
+ export const automationOperationDescriptionSchema = automationOperationSchema
19
+ .extend({ input_schema: z.record(z.unknown()) })
20
+ .strict();
21
+ export const automationApprovalSchema = z
22
+ .object({
23
+ approval_url: z.string().url(),
24
+ expires_at: z.string().datetime({ offset: true }),
25
+ id: z.string().min(1),
26
+ status: z.literal('pending'),
27
+ })
28
+ .strict();
29
+ export const automationOperationSearchResponseSchema = z
30
+ .object({ operations: z.array(automationOperationSchema) })
31
+ .strict();
32
+ export const automationOperationDescriptionResponseSchema = z
33
+ .object({
34
+ approval: automationApprovalSchema.optional(),
35
+ operation: automationOperationDescriptionSchema,
36
+ })
37
+ .strict();
38
+ export const automationInvocationResponseSchema = z
39
+ .object({
40
+ body: z.unknown(),
41
+ headers: z.record(z.string()),
42
+ operation_id: z.string(),
43
+ status: z.number().int().min(100).max(599),
44
+ })
45
+ .strict();
46
+ //# sourceMappingURL=automation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automation.js","sourceRoot":"","sources":["../../src/schemas/automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE/F,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC;IACN,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE;IAClC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,MAAM,EAAE,eAAe;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,mBAAmB,EAAE,uBAAuB,CAAC,QAAQ,EAAE;IACvD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAA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xB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;CAC3C,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -0,0 +1,76 @@
1
+ import { z } from 'zod';
2
+ export declare const apiOperationRiskSchema: z.ZodEnum<["read", "write", "destructive", "external_effect"]>;
3
+ export declare const apiMethodSchema: z.ZodEnum<["DELETE", "GET", "PATCH", "POST", "PUT"]>;
4
+ export declare const pathParameterKindSchema: z.ZodEnum<["opaque", "uuid"]>;
5
+ export declare const automationInputSchema: z.ZodObject<{
6
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
8
+ }, "strict", z.ZodTypeAny, {
9
+ body?: Record<string, unknown> | undefined;
10
+ params?: Record<string, string> | undefined;
11
+ }, {
12
+ body?: Record<string, unknown> | undefined;
13
+ params?: Record<string, string> | undefined;
14
+ }>;
15
+ export declare const searchOperationsRequestSchema: z.ZodObject<{
16
+ query: z.ZodOptional<z.ZodString>;
17
+ }, "strict", z.ZodTypeAny, {
18
+ query?: string | undefined;
19
+ }, {
20
+ query?: string | undefined;
21
+ }>;
22
+ export declare const describeOperationRequestSchema: z.ZodObject<{
23
+ input: z.ZodOptional<z.ZodObject<{
24
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
25
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
26
+ }, "strict", z.ZodTypeAny, {
27
+ body?: Record<string, unknown> | undefined;
28
+ params?: Record<string, string> | undefined;
29
+ }, {
30
+ body?: Record<string, unknown> | undefined;
31
+ params?: Record<string, string> | undefined;
32
+ }>>;
33
+ operation_id: z.ZodString;
34
+ }, "strict", z.ZodTypeAny, {
35
+ input?: {
36
+ body?: Record<string, unknown> | undefined;
37
+ params?: Record<string, string> | undefined;
38
+ } | undefined;
39
+ operation_id: string;
40
+ }, {
41
+ input?: {
42
+ body?: Record<string, unknown> | undefined;
43
+ params?: Record<string, string> | undefined;
44
+ } | undefined;
45
+ operation_id: string;
46
+ }>;
47
+ export declare const invokeOperationRequestSchema: z.ZodObject<{
48
+ input: z.ZodOptional<z.ZodObject<{
49
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
51
+ }, "strict", z.ZodTypeAny, {
52
+ body?: Record<string, unknown> | undefined;
53
+ params?: Record<string, string> | undefined;
54
+ }, {
55
+ body?: Record<string, unknown> | undefined;
56
+ params?: Record<string, string> | undefined;
57
+ }>>;
58
+ operation_id: z.ZodString;
59
+ } & {
60
+ approval_id: z.ZodOptional<z.ZodString>;
61
+ }, "strict", z.ZodTypeAny, {
62
+ input?: {
63
+ body?: Record<string, unknown> | undefined;
64
+ params?: Record<string, string> | undefined;
65
+ } | undefined;
66
+ operation_id: string;
67
+ approval_id?: string | undefined;
68
+ }, {
69
+ input?: {
70
+ body?: Record<string, unknown> | undefined;
71
+ params?: Record<string, string> | undefined;
72
+ } | undefined;
73
+ operation_id: string;
74
+ approval_id?: string | undefined;
75
+ }>;
76
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/schemas/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB,gEAA8D,CAAC;AAClG,eAAO,MAAM,eAAe,sDAAoD,CAAC;AACjF,eAAO,MAAM,uBAAuB,+BAA6B,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;;;EAKvB,CAAC;AAEZ,eAAO,MAAM,6BAA6B;;;;;;EAE/B,CAAC;AAEZ,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;EAKhC,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE9B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ export const apiOperationRiskSchema = z.enum(['read', 'write', 'destructive', 'external_effect']);
3
+ export const apiMethodSchema = z.enum(['DELETE', 'GET', 'PATCH', 'POST', 'PUT']);
4
+ export const pathParameterKindSchema = z.enum(['opaque', 'uuid']);
5
+ export const automationInputSchema = z
6
+ .object({
7
+ body: z.record(z.unknown()).optional(),
8
+ params: z.record(z.string()).optional(),
9
+ })
10
+ .strict();
11
+ export const searchOperationsRequestSchema = z
12
+ .object({ query: z.string().max(200).optional() })
13
+ .strict();
14
+ export const describeOperationRequestSchema = z
15
+ .object({
16
+ input: automationInputSchema.optional(),
17
+ operation_id: z.string().min(1),
18
+ })
19
+ .strict();
20
+ export const invokeOperationRequestSchema = describeOperationRequestSchema
21
+ .extend({ approval_id: z.string().uuid().optional() })
22
+ .strict();
23
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/schemas/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAElE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MA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