@jaypie/mcp 0.2.7 → 0.2.8
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_Vocabulary_Package.md +105 -10
package/dist/index.js
CHANGED
|
@@ -885,7 +885,7 @@ function listLlmProviders() {
|
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
-
const BUILD_VERSION_STRING = "@jaypie/mcp@0.2.
|
|
888
|
+
const BUILD_VERSION_STRING = "@jaypie/mcp@0.2.8"
|
|
889
889
|
;
|
|
890
890
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
891
891
|
const __dirname$1 = path.dirname(__filename$1);
|
package/package.json
CHANGED
|
@@ -162,6 +162,7 @@ Context callbacks connect to adapter registration:
|
|
|
162
162
|
| `String` | `"string"`, `""` | String coercion |
|
|
163
163
|
| `Number` | `"number"` | Number coercion |
|
|
164
164
|
| `Boolean` | `"boolean"` | Boolean coercion |
|
|
165
|
+
| `Date` | `DateType` | Date coercion (ISO strings, timestamps) |
|
|
165
166
|
| `Array` | `"array"`, `[]` | Array coercion |
|
|
166
167
|
| `Object` | `"object"`, `{}` | Object coercion |
|
|
167
168
|
| `[String]` | `[""]` | Typed array of strings |
|
|
@@ -171,6 +172,7 @@ Context callbacks connect to adapter registration:
|
|
|
171
172
|
| `/regex/` | - | String with regex validation |
|
|
172
173
|
| `["a", "b"]` | - | Validated string (must match) |
|
|
173
174
|
| `[1, 2, 3]` | - | Validated number (must match) |
|
|
175
|
+
| `StatusType` | - | Validated status ("pending", "processing", etc.) |
|
|
174
176
|
|
|
175
177
|
### Coercion Examples
|
|
176
178
|
|
|
@@ -201,6 +203,14 @@ coerce([1, 2], [String]); // → ["1", "2"]
|
|
|
201
203
|
coerce({ value: "42" }, Number); // → 42
|
|
202
204
|
coerce(["true"], Boolean); // → true
|
|
203
205
|
coerce('{"value": 5}', Number); // → 5
|
|
206
|
+
|
|
207
|
+
// Date coercion
|
|
208
|
+
import { coerceToDate, coerceFromDate } from "@jaypie/vocabulary";
|
|
209
|
+
|
|
210
|
+
coerceToDate("2026-01-15T10:30:00Z"); // → Date object
|
|
211
|
+
coerceToDate(1736942400000); // → Date from timestamp
|
|
212
|
+
coerceFromDate(new Date(), String); // → ISO string
|
|
213
|
+
coerceFromDate(new Date(), Number); // → Unix timestamp (ms)
|
|
204
214
|
```
|
|
205
215
|
|
|
206
216
|
### RegExp Type Shorthand
|
|
@@ -236,6 +246,30 @@ input: {
|
|
|
236
246
|
}
|
|
237
247
|
```
|
|
238
248
|
|
|
249
|
+
### StatusType
|
|
250
|
+
|
|
251
|
+
A predefined validated string type for common status values:
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
import { StatusType, isStatus, STATUS_VALUES } from "@jaypie/vocabulary";
|
|
255
|
+
|
|
256
|
+
// StatusType is: ["canceled", "complete", "error", "pending", "processing", "queued", "sending"]
|
|
257
|
+
|
|
258
|
+
const handler = serviceHandler({
|
|
259
|
+
input: {
|
|
260
|
+
status: { type: StatusType, default: "pending" },
|
|
261
|
+
},
|
|
262
|
+
service: ({ status }) => status,
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
await handler({ status: "processing" }); // ✓
|
|
266
|
+
await handler({ status: "invalid" }); // ✗ BadRequestError
|
|
267
|
+
|
|
268
|
+
// Type guard
|
|
269
|
+
isStatus("pending"); // → true
|
|
270
|
+
isStatus("unknown"); // → false
|
|
271
|
+
```
|
|
272
|
+
|
|
239
273
|
## Entity Types
|
|
240
274
|
|
|
241
275
|
The vocabulary provides standard entity types for consistent data modeling:
|
|
@@ -302,6 +336,40 @@ progress?:
|
|
|
302
336
|
nextPercentageCheckpoint?: Number
|
|
303
337
|
```
|
|
304
338
|
|
|
339
|
+
### BaseEntity Utilities
|
|
340
|
+
|
|
341
|
+
Field constants and utility functions for working with entities:
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
import {
|
|
345
|
+
// Field name constants
|
|
346
|
+
BASE_ENTITY_FIELDS, // All field names as constants
|
|
347
|
+
BASE_ENTITY_REQUIRED_FIELDS, // ["createdAt", "id", "model", "updatedAt"]
|
|
348
|
+
BASE_ENTITY_AUTO_FIELDS, // ["createdAt", "history", "id", "updatedAt"]
|
|
349
|
+
BASE_ENTITY_TIMESTAMP_FIELDS, // ["archivedAt", "createdAt", "deletedAt", "updatedAt"]
|
|
350
|
+
|
|
351
|
+
// Type guards
|
|
352
|
+
isBaseEntity, // Check if value is a complete BaseEntity
|
|
353
|
+
hasBaseEntityShape, // Check if value has minimum shape (id + model)
|
|
354
|
+
|
|
355
|
+
// Field helpers
|
|
356
|
+
isAutoField, // Check if field is auto-generated
|
|
357
|
+
isTimestampField, // Check if field is a timestamp
|
|
358
|
+
|
|
359
|
+
// Utilities
|
|
360
|
+
createBaseEntityInput, // Create minimal input with required model
|
|
361
|
+
pickBaseEntityFields, // Extract only BaseEntity fields from object
|
|
362
|
+
} from "@jaypie/vocabulary";
|
|
363
|
+
|
|
364
|
+
// Example: Check if a field should be auto-generated
|
|
365
|
+
isAutoField("id"); // → true
|
|
366
|
+
isAutoField("name"); // → false
|
|
367
|
+
|
|
368
|
+
// Example: Extract BaseEntity fields from mixed object
|
|
369
|
+
const mixed = { id: "123", model: "record", customField: "value" };
|
|
370
|
+
pickBaseEntityFields(mixed); // → { id: "123", model: "record" }
|
|
371
|
+
```
|
|
372
|
+
|
|
305
373
|
## TypeScript Types
|
|
306
374
|
|
|
307
375
|
```typescript
|
|
@@ -315,20 +383,22 @@ import type {
|
|
|
315
383
|
Job,
|
|
316
384
|
MessageEntity,
|
|
317
385
|
Progress,
|
|
386
|
+
Status,
|
|
318
387
|
|
|
319
388
|
// Message types
|
|
320
389
|
Message,
|
|
321
390
|
MessageLevel,
|
|
322
391
|
|
|
323
392
|
// Coercion types
|
|
393
|
+
ArrayElementType,
|
|
324
394
|
CoercionType,
|
|
325
|
-
ScalarType,
|
|
326
395
|
CompositeType,
|
|
396
|
+
DateCoercionType,
|
|
397
|
+
RegExpType,
|
|
398
|
+
ScalarType,
|
|
327
399
|
TypedArrayType,
|
|
328
|
-
ValidatedStringType,
|
|
329
400
|
ValidatedNumberType,
|
|
330
|
-
|
|
331
|
-
ArrayElementType,
|
|
401
|
+
ValidatedStringType,
|
|
332
402
|
|
|
333
403
|
// Service handler types
|
|
334
404
|
InputFieldDefinition,
|
|
@@ -358,6 +428,20 @@ interface Message {
|
|
|
358
428
|
### Main Export (`@jaypie/vocabulary`)
|
|
359
429
|
|
|
360
430
|
```typescript
|
|
431
|
+
// BaseEntity utilities
|
|
432
|
+
export {
|
|
433
|
+
BASE_ENTITY_AUTO_FIELDS,
|
|
434
|
+
BASE_ENTITY_FIELDS,
|
|
435
|
+
BASE_ENTITY_REQUIRED_FIELDS,
|
|
436
|
+
BASE_ENTITY_TIMESTAMP_FIELDS,
|
|
437
|
+
createBaseEntityInput,
|
|
438
|
+
hasBaseEntityShape,
|
|
439
|
+
isAutoField,
|
|
440
|
+
isBaseEntity,
|
|
441
|
+
isTimestampField,
|
|
442
|
+
pickBaseEntityFields,
|
|
443
|
+
} from "./base-entity.js";
|
|
444
|
+
|
|
361
445
|
// Coercion functions
|
|
362
446
|
export {
|
|
363
447
|
coerce,
|
|
@@ -370,17 +454,28 @@ export {
|
|
|
370
454
|
coerceToString,
|
|
371
455
|
} from "./coerce.js";
|
|
372
456
|
|
|
457
|
+
// Date coercion
|
|
458
|
+
export {
|
|
459
|
+
coerceFromDate,
|
|
460
|
+
coerceToDate,
|
|
461
|
+
DateType,
|
|
462
|
+
isDateType,
|
|
463
|
+
isValidDate,
|
|
464
|
+
} from "./coerce-date.js";
|
|
465
|
+
|
|
466
|
+
// Status type
|
|
467
|
+
export { isStatus, STATUS_VALUES, StatusType } from "./status.js";
|
|
468
|
+
|
|
373
469
|
// Service Handler
|
|
374
470
|
export { serviceHandler } from "./serviceHandler.js";
|
|
375
471
|
|
|
376
|
-
//
|
|
377
|
-
export * as commander from "./commander/index.js";
|
|
378
|
-
export * as lambda from "./lambda/index.js";
|
|
472
|
+
// LLM adapter (re-exported, no optional deps)
|
|
379
473
|
export * as llm from "./llm/index.js";
|
|
380
|
-
export * as mcp from "./mcp/index.js";
|
|
381
474
|
|
|
382
|
-
//
|
|
383
|
-
|
|
475
|
+
// Note: Other adapters have optional dependencies and must be imported directly:
|
|
476
|
+
// import { registerServiceCommand } from "@jaypie/vocabulary/commander";
|
|
477
|
+
// import { lambdaServiceHandler } from "@jaypie/vocabulary/lambda";
|
|
478
|
+
// import { registerMcpTool } from "@jaypie/vocabulary/mcp";
|
|
384
479
|
|
|
385
480
|
// Version
|
|
386
481
|
export const VOCABULARY_VERSION: string;
|