@jaypie/mcp 0.2.9 → 0.2.12
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/dist/index.js +1 -1
- package/package.json +1 -1
- package/prompts/Jaypie_CDK_Constructs_and_Patterns.md +23 -28
- package/prompts/Jaypie_DynamoDB_Package.md +62 -62
- package/prompts/Jaypie_Express_Package.md +101 -44
- package/prompts/{Jaypie_Vocabulary_Commander.md → Jaypie_Fabric_Commander.md} +38 -38
- package/prompts/{Jaypie_Vocabulary_LLM.md → Jaypie_Fabric_LLM.md} +45 -45
- package/prompts/{Jaypie_Vocabulary_Lambda.md → Jaypie_Fabric_Lambda.md} +40 -42
- package/prompts/{Jaypie_Vocabulary_MCP.md → Jaypie_Fabric_MCP.md} +39 -39
- package/prompts/{Jaypie_Vocabulary_Package.md → Jaypie_Fabric_Package.md} +151 -142
- package/prompts/Jaypie_Init_CICD_with_GitHub_Actions.md +12 -12
- package/prompts/Jaypie_Streaming.md +408 -0
- package/prompts/Templates_Express_Subpackage.md +6 -2
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Core guide to Jaypie
|
|
2
|
+
description: Core guide to Jaypie Fabric for type conversion, service handlers, and model types
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Jaypie
|
|
5
|
+
# Jaypie Fabric Package
|
|
6
6
|
|
|
7
|
-
Jaypie
|
|
7
|
+
Jaypie Fabric (`@jaypie/fabric`) provides type conversion utilities, service handler patterns, and model types for consistent input handling across Jaypie applications.
|
|
8
8
|
|
|
9
9
|
## Related Adapter Guides
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Fabric includes adapters for integrating service handlers with various platforms. See these guides for platform-specific integration:
|
|
12
12
|
|
|
13
13
|
| Guide | Import | Description |
|
|
14
14
|
|-------|--------|-------------|
|
|
15
|
-
| [
|
|
16
|
-
| [
|
|
17
|
-
| [
|
|
18
|
-
| [
|
|
15
|
+
| [Jaypie_Fabric_Commander.md](Jaypie_Fabric_Commander.md) | `@jaypie/fabric/commander` | Commander.js CLI integration with callbacks |
|
|
16
|
+
| [Jaypie_Fabric_Lambda.md](Jaypie_Fabric_Lambda.md) | `@jaypie/fabric/lambda` | AWS Lambda handler wrapping |
|
|
17
|
+
| [Jaypie_Fabric_LLM.md](Jaypie_Fabric_LLM.md) | `@jaypie/fabric/llm` | LLM tool creation for `@jaypie/llm` Toolkit |
|
|
18
|
+
| [Jaypie_Fabric_MCP.md](Jaypie_Fabric_MCP.md) | `@jaypie/fabric/mcp` | MCP server tool registration |
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npm install @jaypie/
|
|
23
|
+
npm install @jaypie/fabric
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Core Concepts
|
|
27
27
|
|
|
28
28
|
### Design Philosophy
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Fabric follows the "Fabric" philosophy:
|
|
31
31
|
- **Smooth, pliable** - Things that feel right should work
|
|
32
32
|
- **Catch bad passes** - Invalid inputs throw clear errors
|
|
33
33
|
|
|
34
34
|
This means `"true"` works where `true` is expected, `"42"` works where `42` is expected, and invalid conversions fail fast with `BadRequestError`.
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## fabricService
|
|
37
37
|
|
|
38
|
-
Factory function that creates validated service endpoints with automatic type
|
|
38
|
+
Factory function that creates validated service endpoints with automatic type conversion.
|
|
39
39
|
|
|
40
40
|
### Basic Usage
|
|
41
41
|
|
|
42
42
|
```typescript
|
|
43
|
-
import {
|
|
43
|
+
import { fabricService } from "@jaypie/fabric";
|
|
44
44
|
|
|
45
|
-
const divisionHandler =
|
|
45
|
+
const divisionHandler = fabricService({
|
|
46
46
|
alias: "division",
|
|
47
47
|
description: "Divides two numbers",
|
|
48
48
|
input: {
|
|
@@ -63,7 +63,7 @@ const divisionHandler = serviceHandler({
|
|
|
63
63
|
|
|
64
64
|
await divisionHandler(); // → 4
|
|
65
65
|
await divisionHandler({ numerator: 24 }); // → 8
|
|
66
|
-
await divisionHandler({ numerator: "14", denominator: "7" }); // → 2 (
|
|
66
|
+
await divisionHandler({ numerator: "14", denominator: "7" }); // → 2 (converted)
|
|
67
67
|
await divisionHandler('{"numerator": "18"}'); // → 6 (JSON parsed)
|
|
68
68
|
```
|
|
69
69
|
|
|
@@ -72,7 +72,7 @@ await divisionHandler('{"numerator": "18"}'); // → 6 (JSON parsed)
|
|
|
72
72
|
Config properties are attached directly to the handler for introspection:
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
|
-
const handler =
|
|
75
|
+
const handler = fabricService({
|
|
76
76
|
alias: "greet",
|
|
77
77
|
description: "Greet a user",
|
|
78
78
|
input: { name: { type: String } },
|
|
@@ -88,11 +88,11 @@ handler.input; // { name: { type: String } }
|
|
|
88
88
|
|
|
89
89
|
| Property | Type | Description |
|
|
90
90
|
|----------|------|-------------|
|
|
91
|
-
| `type` | `
|
|
91
|
+
| `type` | `ConversionType` | Required. The target type for conversion |
|
|
92
92
|
| `default` | `unknown` | Default value if not provided |
|
|
93
93
|
| `description` | `string` | Field description (used in CLI help) |
|
|
94
94
|
| `required` | `boolean` | Whether field is required (default: true unless default set) |
|
|
95
|
-
| `validate` | `function \| RegExp \| array` | Validation after
|
|
95
|
+
| `validate` | `function \| RegExp \| array` | Validation after conversion |
|
|
96
96
|
| `flag` | `string` | Override long flag name for Commander.js |
|
|
97
97
|
| `letter` | `string` | Short switch letter for Commander.js |
|
|
98
98
|
|
|
@@ -101,7 +101,7 @@ handler.input; // { name: { type: String } }
|
|
|
101
101
|
When no `service` function is provided, the handler returns the processed input:
|
|
102
102
|
|
|
103
103
|
```typescript
|
|
104
|
-
const validateUser =
|
|
104
|
+
const validateUser = fabricService({
|
|
105
105
|
input: {
|
|
106
106
|
age: { type: Number, validate: (v) => v >= 18 },
|
|
107
107
|
email: { type: /^[^@]+@[^@]+\.[^@]+$/ },
|
|
@@ -124,7 +124,7 @@ interface ServiceContext {
|
|
|
124
124
|
sendMessage?: (message: Message) => void | Promise<void>;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
const handler =
|
|
127
|
+
const handler = fabricService({
|
|
128
128
|
input: { jobId: { type: String } },
|
|
129
129
|
service: async ({ jobId }, context) => {
|
|
130
130
|
context?.sendMessage?.({ content: `Starting job ${jobId}` });
|
|
@@ -153,18 +153,18 @@ Context callbacks connect to adapter registration:
|
|
|
153
153
|
|
|
154
154
|
**Note:** Any error that escapes the service (is thrown) is treated as fatal and routes to `onFatal`.
|
|
155
155
|
|
|
156
|
-
## Type
|
|
156
|
+
## Type Conversion
|
|
157
157
|
|
|
158
158
|
### Supported Types
|
|
159
159
|
|
|
160
160
|
| Type | Aliases | Description |
|
|
161
161
|
|------|---------|-------------|
|
|
162
|
-
| `String` | `"string"`, `""` | String
|
|
163
|
-
| `Number` | `"number"` | Number
|
|
164
|
-
| `Boolean` | `"boolean"` | Boolean
|
|
165
|
-
| `Date` | `DateType` | Date
|
|
166
|
-
| `Array` | `"array"`, `[]` | Array
|
|
167
|
-
| `Object` | `"object"`, `{}` | Object
|
|
162
|
+
| `String` | `"string"`, `""` | String conversion |
|
|
163
|
+
| `Number` | `"number"` | Number conversion |
|
|
164
|
+
| `Boolean` | `"boolean"` | Boolean conversion |
|
|
165
|
+
| `Date` | `DateType` | Date conversion (ISO strings, timestamps) |
|
|
166
|
+
| `Array` | `"array"`, `[]` | Array conversion |
|
|
167
|
+
| `Object` | `"object"`, `{}` | Object conversion |
|
|
168
168
|
| `[String]` | `[""]` | Typed array of strings |
|
|
169
169
|
| `[Number]` | - | Typed array of numbers |
|
|
170
170
|
| `[Boolean]` | - | Typed array of booleans |
|
|
@@ -174,51 +174,51 @@ Context callbacks connect to adapter registration:
|
|
|
174
174
|
| `[1, 2, 3]` | - | Validated number (must match) |
|
|
175
175
|
| `StatusType` | - | Validated status ("pending", "processing", etc.) |
|
|
176
176
|
|
|
177
|
-
###
|
|
177
|
+
### Conversion Examples
|
|
178
178
|
|
|
179
179
|
```typescript
|
|
180
|
-
import {
|
|
180
|
+
import { fabric, fabricBoolean, fabricNumber, fabricString } from "@jaypie/fabric";
|
|
181
181
|
|
|
182
|
-
// Boolean
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
// Boolean conversion
|
|
183
|
+
fabricBoolean("true"); // → true
|
|
184
|
+
fabricBoolean("false"); // → false
|
|
185
|
+
fabricBoolean(1); // → true
|
|
186
|
+
fabricBoolean(0); // → false
|
|
187
187
|
|
|
188
|
-
// Number
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
// Number conversion
|
|
189
|
+
fabricNumber("42"); // → 42
|
|
190
|
+
fabricNumber("true"); // → 1
|
|
191
|
+
fabricNumber("false"); // → 0
|
|
192
192
|
|
|
193
|
-
// String
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
// String conversion
|
|
194
|
+
fabricString(true); // → "true"
|
|
195
|
+
fabricString(42); // → "42"
|
|
196
196
|
|
|
197
|
-
// Array
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
// Array conversion
|
|
198
|
+
fabric("1,2,3", [Number]); // → [1, 2, 3]
|
|
199
|
+
fabric("a\tb\tc", [String]); // → ["a", "b", "c"]
|
|
200
|
+
fabric([1, 2], [String]); // → ["1", "2"]
|
|
201
201
|
|
|
202
202
|
// Unwrapping
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
fabricNumber({ value: "42" }); // → 42
|
|
204
|
+
fabricBoolean(["true"]); // → true
|
|
205
|
+
fabricNumber('{"value": 5}'); // → 5
|
|
206
206
|
|
|
207
|
-
// Date
|
|
208
|
-
import {
|
|
207
|
+
// Date conversion
|
|
208
|
+
import { fabricDate, resolveFromDate } from "@jaypie/fabric";
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
fabricDate("2026-01-15T10:30:00Z"); // → Date object
|
|
211
|
+
fabricDate(1736942400000); // → Date from timestamp
|
|
212
|
+
resolveFromDate(new Date(), String); // → ISO string
|
|
213
|
+
resolveFromDate(new Date(), Number); // → Unix timestamp (ms)
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
### RegExp Type Shorthand
|
|
217
217
|
|
|
218
|
-
A bare RegExp
|
|
218
|
+
A bare RegExp converts to String and validates:
|
|
219
219
|
|
|
220
220
|
```typescript
|
|
221
|
-
const handler =
|
|
221
|
+
const handler = fabricService({
|
|
222
222
|
input: {
|
|
223
223
|
email: { type: /^[^@]+@[^@]+\.[^@]+$/ },
|
|
224
224
|
},
|
|
@@ -251,11 +251,11 @@ input: {
|
|
|
251
251
|
A predefined validated string type for common status values:
|
|
252
252
|
|
|
253
253
|
```typescript
|
|
254
|
-
import { StatusType, isStatus, STATUS_VALUES } from "@jaypie/
|
|
254
|
+
import { StatusType, isStatus, STATUS_VALUES } from "@jaypie/fabric";
|
|
255
255
|
|
|
256
256
|
// StatusType is: ["canceled", "complete", "error", "pending", "processing", "queued", "sending"]
|
|
257
257
|
|
|
258
|
-
const handler =
|
|
258
|
+
const handler = fabricService({
|
|
259
259
|
input: {
|
|
260
260
|
status: { type: StatusType, default: "pending" },
|
|
261
261
|
},
|
|
@@ -270,31 +270,31 @@ isStatus("pending"); // → true
|
|
|
270
270
|
isStatus("unknown"); // → false
|
|
271
271
|
```
|
|
272
272
|
|
|
273
|
-
##
|
|
273
|
+
## Model Types
|
|
274
274
|
|
|
275
|
-
|
|
275
|
+
Fabric provides standard model types for consistent data modeling:
|
|
276
276
|
|
|
277
277
|
```typescript
|
|
278
278
|
import type {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
} from "@jaypie/
|
|
279
|
+
FabricModel,
|
|
280
|
+
FabricModelInput,
|
|
281
|
+
FabricModelUpdate,
|
|
282
|
+
FabricModelFilter,
|
|
283
|
+
FabricHistoryEntry,
|
|
284
|
+
FabricJob,
|
|
285
|
+
FabricMessage,
|
|
286
|
+
FabricProgress,
|
|
287
|
+
} from "@jaypie/fabric";
|
|
288
288
|
```
|
|
289
289
|
|
|
290
|
-
###
|
|
290
|
+
### FabricModel (base for all models)
|
|
291
291
|
|
|
292
292
|
```
|
|
293
293
|
model: <varies>
|
|
294
294
|
id: String (auto)
|
|
295
295
|
createdAt: Date (auto)
|
|
296
296
|
updatedAt: Date (auto)
|
|
297
|
-
history?: [
|
|
297
|
+
history?: [FabricHistoryEntry] (auto)
|
|
298
298
|
name?: String
|
|
299
299
|
label?: String
|
|
300
300
|
abbreviation?: String
|
|
@@ -311,7 +311,7 @@ archivedAt?: Date
|
|
|
311
311
|
deletedAt?: Date
|
|
312
312
|
```
|
|
313
313
|
|
|
314
|
-
###
|
|
314
|
+
### FabricMessage (extends FabricModel)
|
|
315
315
|
|
|
316
316
|
```
|
|
317
317
|
model: message
|
|
@@ -319,7 +319,7 @@ content: String (required)
|
|
|
319
319
|
type?: String (e.g., "assistant", "user", "system")
|
|
320
320
|
```
|
|
321
321
|
|
|
322
|
-
###
|
|
322
|
+
### FabricJob (extends FabricModel)
|
|
323
323
|
|
|
324
324
|
```
|
|
325
325
|
model: job
|
|
@@ -328,72 +328,81 @@ class?: String (e.g., "evaluation", "export", "import")
|
|
|
328
328
|
status: String (required)
|
|
329
329
|
startedAt?: Date
|
|
330
330
|
completedAt?: Date
|
|
331
|
-
messages?: [
|
|
332
|
-
progress?:
|
|
333
|
-
elapsedTime?: Number
|
|
334
|
-
estimatedTime?: Number
|
|
335
|
-
percentageComplete?: Number
|
|
336
|
-
nextPercentageCheckpoint?: Number
|
|
331
|
+
messages?: [FabricMessage]
|
|
332
|
+
progress?: FabricProgress (value object, not a model)
|
|
337
333
|
```
|
|
338
334
|
|
|
339
|
-
###
|
|
335
|
+
### FabricProgress (value object)
|
|
340
336
|
|
|
341
|
-
|
|
337
|
+
FabricProgress is a **value object** (not a model) embedded in FabricJob:
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
interface FabricProgress {
|
|
341
|
+
elapsedTime?: number;
|
|
342
|
+
estimatedTime?: number;
|
|
343
|
+
percentageComplete?: number;
|
|
344
|
+
nextPercentageCheckpoint?: number;
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### FabricModel Utilities
|
|
349
|
+
|
|
350
|
+
Field constants and utility functions for working with models:
|
|
342
351
|
|
|
343
352
|
```typescript
|
|
344
353
|
import {
|
|
345
354
|
// Field name constants
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
355
|
+
FABRIC_MODEL_FIELDS, // All field names as constants
|
|
356
|
+
FABRIC_MODEL_REQUIRED_FIELDS, // ["createdAt", "id", "model", "updatedAt"]
|
|
357
|
+
FABRIC_MODEL_AUTO_FIELDS, // ["createdAt", "history", "id", "updatedAt"]
|
|
358
|
+
FABRIC_MODEL_TIMESTAMP_FIELDS, // ["archivedAt", "createdAt", "deletedAt", "updatedAt"]
|
|
350
359
|
|
|
351
360
|
// Type guards
|
|
352
|
-
|
|
353
|
-
|
|
361
|
+
isFabricModel, // Check if value is a complete FabricModel
|
|
362
|
+
hasFabricModelShape, // Check if value has minimum shape (id + model)
|
|
354
363
|
|
|
355
364
|
// Field helpers
|
|
356
365
|
isAutoField, // Check if field is auto-generated
|
|
357
366
|
isTimestampField, // Check if field is a timestamp
|
|
358
367
|
|
|
359
368
|
// Utilities
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
} from "@jaypie/
|
|
369
|
+
createFabricModelInput, // Create minimal input with required model
|
|
370
|
+
pickFabricModelFields, // Extract only FabricModel fields from object
|
|
371
|
+
} from "@jaypie/fabric";
|
|
363
372
|
|
|
364
373
|
// Example: Check if a field should be auto-generated
|
|
365
374
|
isAutoField("id"); // → true
|
|
366
375
|
isAutoField("name"); // → false
|
|
367
376
|
|
|
368
|
-
// Example: Extract
|
|
377
|
+
// Example: Extract FabricModel fields from mixed object
|
|
369
378
|
const mixed = { id: "123", model: "record", customField: "value" };
|
|
370
|
-
|
|
379
|
+
pickFabricModelFields(mixed); // → { id: "123", model: "record" }
|
|
371
380
|
```
|
|
372
381
|
|
|
373
382
|
## TypeScript Types
|
|
374
383
|
|
|
375
384
|
```typescript
|
|
376
385
|
import type {
|
|
377
|
-
//
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
+
// Model types
|
|
387
|
+
FabricModel,
|
|
388
|
+
FabricModelFilter,
|
|
389
|
+
FabricModelInput,
|
|
390
|
+
FabricModelUpdate,
|
|
391
|
+
FabricHistoryEntry,
|
|
392
|
+
FabricJob,
|
|
393
|
+
FabricMessage,
|
|
394
|
+
FabricProgress,
|
|
386
395
|
Status,
|
|
387
396
|
|
|
388
397
|
// Message types
|
|
389
398
|
Message,
|
|
390
399
|
MessageLevel,
|
|
391
400
|
|
|
392
|
-
//
|
|
401
|
+
// Conversion types
|
|
393
402
|
ArrayElementType,
|
|
394
|
-
|
|
403
|
+
ConversionType,
|
|
395
404
|
CompositeType,
|
|
396
|
-
|
|
405
|
+
DateConversionType,
|
|
397
406
|
RegExpType,
|
|
398
407
|
ScalarType,
|
|
399
408
|
TypedArrayType,
|
|
@@ -404,10 +413,10 @@ import type {
|
|
|
404
413
|
InputFieldDefinition,
|
|
405
414
|
ServiceContext,
|
|
406
415
|
ServiceFunction,
|
|
407
|
-
|
|
408
|
-
|
|
416
|
+
ServiceConfig,
|
|
417
|
+
Service,
|
|
409
418
|
ValidateFunction,
|
|
410
|
-
} from "@jaypie/
|
|
419
|
+
} from "@jaypie/fabric";
|
|
411
420
|
```
|
|
412
421
|
|
|
413
422
|
### Message Type
|
|
@@ -425,80 +434,80 @@ interface Message {
|
|
|
425
434
|
|
|
426
435
|
## Exports
|
|
427
436
|
|
|
428
|
-
### Main Export (`@jaypie/
|
|
437
|
+
### Main Export (`@jaypie/fabric`)
|
|
429
438
|
|
|
430
439
|
```typescript
|
|
431
|
-
//
|
|
440
|
+
// FabricModel utilities
|
|
432
441
|
export {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
442
|
+
FABRIC_MODEL_AUTO_FIELDS,
|
|
443
|
+
FABRIC_MODEL_FIELDS,
|
|
444
|
+
FABRIC_MODEL_REQUIRED_FIELDS,
|
|
445
|
+
FABRIC_MODEL_TIMESTAMP_FIELDS,
|
|
446
|
+
createFabricModelInput,
|
|
447
|
+
hasFabricModelShape,
|
|
439
448
|
isAutoField,
|
|
440
|
-
|
|
449
|
+
isFabricModel,
|
|
441
450
|
isTimestampField,
|
|
442
|
-
|
|
443
|
-
} from "./base
|
|
451
|
+
pickFabricModelFields,
|
|
452
|
+
} from "./models/base.js";
|
|
444
453
|
|
|
445
|
-
//
|
|
454
|
+
// Resolution functions
|
|
446
455
|
export {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
} from "./
|
|
456
|
-
|
|
457
|
-
// Date
|
|
456
|
+
fabric,
|
|
457
|
+
fabricArray,
|
|
458
|
+
fabricBoolean,
|
|
459
|
+
fabricNumber,
|
|
460
|
+
fabricObject,
|
|
461
|
+
fabricString,
|
|
462
|
+
resolveFromArray,
|
|
463
|
+
resolveFromObject,
|
|
464
|
+
} from "./resolve.js";
|
|
465
|
+
|
|
466
|
+
// Date resolution
|
|
458
467
|
export {
|
|
459
|
-
|
|
460
|
-
coerceToDate,
|
|
468
|
+
fabricDate,
|
|
461
469
|
DateType,
|
|
462
470
|
isDateType,
|
|
463
471
|
isValidDate,
|
|
464
|
-
|
|
472
|
+
resolveFromDate,
|
|
473
|
+
} from "./resolve-date.js";
|
|
465
474
|
|
|
466
475
|
// Status type
|
|
467
476
|
export { isStatus, STATUS_VALUES, StatusType } from "./status.js";
|
|
468
477
|
|
|
469
478
|
// Service Handler
|
|
470
|
-
export {
|
|
479
|
+
export { fabricService } from "./service.js";
|
|
471
480
|
|
|
472
481
|
// LLM adapter (re-exported, no optional deps)
|
|
473
482
|
export * as llm from "./llm/index.js";
|
|
474
483
|
|
|
475
484
|
// Note: Other adapters have optional dependencies and must be imported directly:
|
|
476
|
-
// import {
|
|
477
|
-
// import {
|
|
478
|
-
// import {
|
|
485
|
+
// import { fabricCommand } from "@jaypie/fabric/commander";
|
|
486
|
+
// import { fabricLambda } from "@jaypie/fabric/lambda";
|
|
487
|
+
// import { fabricMcp } from "@jaypie/fabric/mcp";
|
|
479
488
|
|
|
480
489
|
// Version
|
|
481
|
-
export const
|
|
490
|
+
export const FABRIC_VERSION: string;
|
|
482
491
|
```
|
|
483
492
|
|
|
484
493
|
## Error Handling
|
|
485
494
|
|
|
486
|
-
Invalid
|
|
495
|
+
Invalid conversions throw `BadRequestError` from `@jaypie/errors`:
|
|
487
496
|
|
|
488
497
|
```typescript
|
|
489
498
|
import { BadRequestError } from "@jaypie/errors";
|
|
490
499
|
|
|
491
500
|
// These throw BadRequestError:
|
|
492
|
-
await handler({ numerator: "not-a-number" }); // Cannot
|
|
501
|
+
await handler({ numerator: "not-a-number" }); // Cannot convert to Number
|
|
493
502
|
await handler({ priority: 10 }); // Validation fails (not in [1,2,3,4,5])
|
|
494
503
|
await handler({}); // Missing required field
|
|
495
504
|
```
|
|
496
505
|
|
|
497
506
|
## Integration with Other Packages
|
|
498
507
|
|
|
499
|
-
|
|
508
|
+
Fabric is designed to be consumed by:
|
|
500
509
|
- **`@jaypie/lambda`** - Lambda handler input processing
|
|
501
510
|
- **`@jaypie/express`** - Express route input validation
|
|
502
|
-
- **`@jaypie/llm`** - LLM tool parameter
|
|
511
|
+
- **`@jaypie/llm`** - LLM tool parameter conversion via the llm adapter
|
|
503
512
|
- **`@jaypie/mcp`** - MCP server tool registration via the mcp adapter
|
|
504
513
|
- **CLI packages** - Commander.js integration via the commander adapter
|
|
@@ -383,7 +383,7 @@ jobs:
|
|
|
383
383
|
- name: Setup Node.js and Cache
|
|
384
384
|
uses: ./.github/actions/setup-node-and-cache
|
|
385
385
|
with:
|
|
386
|
-
node-version:
|
|
386
|
+
node-version: 24
|
|
387
387
|
|
|
388
388
|
- name: Install and Build
|
|
389
389
|
uses: ./.github/actions/npm-install-build
|
|
@@ -404,7 +404,7 @@ jobs:
|
|
|
404
404
|
id: setup-cache
|
|
405
405
|
uses: ./.github/actions/setup-node-and-cache
|
|
406
406
|
with:
|
|
407
|
-
node-version:
|
|
407
|
+
node-version: 24
|
|
408
408
|
|
|
409
409
|
- name: Install dependencies
|
|
410
410
|
if: steps.setup-cache.outputs.node-modules-cache-hit != 'true'
|
|
@@ -421,7 +421,7 @@ jobs:
|
|
|
421
421
|
runs-on: ubuntu-latest
|
|
422
422
|
strategy:
|
|
423
423
|
matrix:
|
|
424
|
-
node-version: [
|
|
424
|
+
node-version: [22.x, 24.x]
|
|
425
425
|
steps:
|
|
426
426
|
- name: Checkout code
|
|
427
427
|
uses: actions/checkout@v4
|
|
@@ -500,7 +500,7 @@ jobs:
|
|
|
500
500
|
- name: Setup Node.js and Cache
|
|
501
501
|
uses: ./.github/actions/setup-node-and-cache
|
|
502
502
|
with:
|
|
503
|
-
node-version:
|
|
503
|
+
node-version: 24
|
|
504
504
|
|
|
505
505
|
- name: Install and Build
|
|
506
506
|
uses: ./.github/actions/npm-install-build
|
|
@@ -521,7 +521,7 @@ jobs:
|
|
|
521
521
|
id: setup-cache
|
|
522
522
|
uses: ./.github/actions/setup-node-and-cache
|
|
523
523
|
with:
|
|
524
|
-
node-version:
|
|
524
|
+
node-version: 24
|
|
525
525
|
|
|
526
526
|
- name: Install dependencies
|
|
527
527
|
if: steps.setup-cache.outputs.node-modules-cache-hit != 'true'
|
|
@@ -538,7 +538,7 @@ jobs:
|
|
|
538
538
|
runs-on: ubuntu-latest
|
|
539
539
|
strategy:
|
|
540
540
|
matrix:
|
|
541
|
-
node-version: [
|
|
541
|
+
node-version: [22.x, 24.x]
|
|
542
542
|
steps:
|
|
543
543
|
- name: Checkout code
|
|
544
544
|
uses: actions/checkout@v4
|
|
@@ -626,7 +626,7 @@ jobs:
|
|
|
626
626
|
- name: Setup Node.js and Cache
|
|
627
627
|
uses: ./.github/actions/setup-node-and-cache
|
|
628
628
|
with:
|
|
629
|
-
node-version:
|
|
629
|
+
node-version: 24
|
|
630
630
|
|
|
631
631
|
- name: Install and Build
|
|
632
632
|
uses: ./.github/actions/npm-install-build
|
|
@@ -647,7 +647,7 @@ jobs:
|
|
|
647
647
|
id: setup-cache
|
|
648
648
|
uses: ./.github/actions/setup-node-and-cache
|
|
649
649
|
with:
|
|
650
|
-
node-version:
|
|
650
|
+
node-version: 24
|
|
651
651
|
|
|
652
652
|
- name: Install dependencies
|
|
653
653
|
if: steps.setup-cache.outputs.node-modules-cache-hit != 'true'
|
|
@@ -664,7 +664,7 @@ jobs:
|
|
|
664
664
|
runs-on: ubuntu-latest
|
|
665
665
|
strategy:
|
|
666
666
|
matrix:
|
|
667
|
-
node-version: [
|
|
667
|
+
node-version: [22.x, 24.x]
|
|
668
668
|
steps:
|
|
669
669
|
- name: Checkout code
|
|
670
670
|
uses: actions/checkout@v4
|
|
@@ -716,7 +716,7 @@ jobs:
|
|
|
716
716
|
id: setup-cache
|
|
717
717
|
uses: ./.github/actions/setup-node-and-cache
|
|
718
718
|
with:
|
|
719
|
-
node-version:
|
|
719
|
+
node-version: 24
|
|
720
720
|
|
|
721
721
|
- name: Install dependencies
|
|
722
722
|
if: steps.setup-cache.outputs.node-modules-cache-hit != 'true'
|
|
@@ -733,7 +733,7 @@ jobs:
|
|
|
733
733
|
runs-on: ubuntu-latest
|
|
734
734
|
strategy:
|
|
735
735
|
matrix:
|
|
736
|
-
node-version: [
|
|
736
|
+
node-version: [22.x, 24.x]
|
|
737
737
|
steps:
|
|
738
738
|
- name: Checkout code
|
|
739
739
|
uses: actions/checkout@v4
|
|
@@ -812,7 +812,7 @@ jobs:
|
|
|
812
812
|
- name: Setup Node.js
|
|
813
813
|
uses: actions/setup-node@v4
|
|
814
814
|
with:
|
|
815
|
-
node-version:
|
|
815
|
+
node-version: 24
|
|
816
816
|
|
|
817
817
|
- name: Configure Git
|
|
818
818
|
run: |
|