pcbway-mcp-server 0.1.0 → 0.1.1
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/package.json +1 -1
- package/dist/resources/AssemblyQuote.d.ts +0 -144
- package/dist/resources/AssemblyQuote.d.ts.map +0 -1
- package/dist/resources/AssemblyQuote.js +0 -102
- package/dist/resources/AssemblyQuote.js.map +0 -1
- package/dist/resources/Order.d.ts +0 -25
- package/dist/resources/Order.d.ts.map +0 -1
- package/dist/resources/Order.js +0 -59
- package/dist/resources/Order.js.map +0 -1
- package/dist/resources/Status.d.ts +0 -27
- package/dist/resources/Status.d.ts.map +0 -1
- package/dist/resources/Status.js +0 -47
- package/dist/resources/Status.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { PcbWayClient } from '../client.js';
|
|
3
|
-
/**
|
|
4
|
-
* PCB Assembly Quote resource.
|
|
5
|
-
*
|
|
6
|
-
* Tool: assembly_quote
|
|
7
|
-
* Posts PCB specs + BOM and returns PCBA pricing.
|
|
8
|
-
*/
|
|
9
|
-
export declare class AssemblyQuote {
|
|
10
|
-
private client;
|
|
11
|
-
constructor(client: PcbWayClient);
|
|
12
|
-
/** Zod schema for a single BOM line item. */
|
|
13
|
-
static bomItemSchema: z.ZodObject<{
|
|
14
|
-
refDes: z.ZodString;
|
|
15
|
-
mpn: z.ZodOptional<z.ZodString>;
|
|
16
|
-
value: z.ZodOptional<z.ZodString>;
|
|
17
|
-
package: z.ZodOptional<z.ZodString>;
|
|
18
|
-
quantity: z.ZodNumber;
|
|
19
|
-
category: z.ZodOptional<z.ZodString>;
|
|
20
|
-
supplier: z.ZodOptional<z.ZodString>;
|
|
21
|
-
notes: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
quantity: number;
|
|
24
|
-
refDes: string;
|
|
25
|
-
value?: string | undefined;
|
|
26
|
-
mpn?: string | undefined;
|
|
27
|
-
package?: string | undefined;
|
|
28
|
-
category?: string | undefined;
|
|
29
|
-
supplier?: string | undefined;
|
|
30
|
-
notes?: string | undefined;
|
|
31
|
-
}, {
|
|
32
|
-
quantity: number;
|
|
33
|
-
refDes: string;
|
|
34
|
-
value?: string | undefined;
|
|
35
|
-
mpn?: string | undefined;
|
|
36
|
-
package?: string | undefined;
|
|
37
|
-
category?: string | undefined;
|
|
38
|
-
supplier?: string | undefined;
|
|
39
|
-
notes?: string | undefined;
|
|
40
|
-
}>;
|
|
41
|
-
/** Zod schema for assembly quote input. */
|
|
42
|
-
static inputSchema: z.ZodObject<{
|
|
43
|
-
length: z.ZodNumber;
|
|
44
|
-
width: z.ZodNumber;
|
|
45
|
-
layers: z.ZodNumber;
|
|
46
|
-
quantity: z.ZodNumber;
|
|
47
|
-
thickness: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
copperWeight: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
surfaceFinish: z.ZodOptional<z.ZodString>;
|
|
50
|
-
solderMask: z.ZodOptional<z.ZodString>;
|
|
51
|
-
material: z.ZodOptional<z.ZodString>;
|
|
52
|
-
bom: z.ZodArray<z.ZodObject<{
|
|
53
|
-
refDes: z.ZodString;
|
|
54
|
-
mpn: z.ZodOptional<z.ZodString>;
|
|
55
|
-
value: z.ZodOptional<z.ZodString>;
|
|
56
|
-
package: z.ZodOptional<z.ZodString>;
|
|
57
|
-
quantity: z.ZodNumber;
|
|
58
|
-
category: z.ZodOptional<z.ZodString>;
|
|
59
|
-
supplier: z.ZodOptional<z.ZodString>;
|
|
60
|
-
notes: z.ZodOptional<z.ZodString>;
|
|
61
|
-
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
quantity: number;
|
|
63
|
-
refDes: string;
|
|
64
|
-
value?: string | undefined;
|
|
65
|
-
mpn?: string | undefined;
|
|
66
|
-
package?: string | undefined;
|
|
67
|
-
category?: string | undefined;
|
|
68
|
-
supplier?: string | undefined;
|
|
69
|
-
notes?: string | undefined;
|
|
70
|
-
}, {
|
|
71
|
-
quantity: number;
|
|
72
|
-
refDes: string;
|
|
73
|
-
value?: string | undefined;
|
|
74
|
-
mpn?: string | undefined;
|
|
75
|
-
package?: string | undefined;
|
|
76
|
-
category?: string | undefined;
|
|
77
|
-
supplier?: string | undefined;
|
|
78
|
-
notes?: string | undefined;
|
|
79
|
-
}>, "many">;
|
|
80
|
-
placementSide: z.ZodOptional<z.ZodEnum<["Top", "Bottom", "Both"]>>;
|
|
81
|
-
stencilType: z.ZodOptional<z.ZodString>;
|
|
82
|
-
testingRequired: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
-
programmingRequired: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
-
conformalCoating: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
-
functionalTest: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
-
}, "strip", z.ZodTypeAny, {
|
|
87
|
-
length: number;
|
|
88
|
-
width: number;
|
|
89
|
-
layers: number;
|
|
90
|
-
quantity: number;
|
|
91
|
-
bom: {
|
|
92
|
-
quantity: number;
|
|
93
|
-
refDes: string;
|
|
94
|
-
value?: string | undefined;
|
|
95
|
-
mpn?: string | undefined;
|
|
96
|
-
package?: string | undefined;
|
|
97
|
-
category?: string | undefined;
|
|
98
|
-
supplier?: string | undefined;
|
|
99
|
-
notes?: string | undefined;
|
|
100
|
-
}[];
|
|
101
|
-
thickness?: number | undefined;
|
|
102
|
-
copperWeight?: number | undefined;
|
|
103
|
-
surfaceFinish?: string | undefined;
|
|
104
|
-
solderMask?: string | undefined;
|
|
105
|
-
material?: string | undefined;
|
|
106
|
-
placementSide?: "Top" | "Bottom" | "Both" | undefined;
|
|
107
|
-
stencilType?: string | undefined;
|
|
108
|
-
testingRequired?: boolean | undefined;
|
|
109
|
-
programmingRequired?: boolean | undefined;
|
|
110
|
-
conformalCoating?: boolean | undefined;
|
|
111
|
-
functionalTest?: boolean | undefined;
|
|
112
|
-
}, {
|
|
113
|
-
length: number;
|
|
114
|
-
width: number;
|
|
115
|
-
layers: number;
|
|
116
|
-
quantity: number;
|
|
117
|
-
bom: {
|
|
118
|
-
quantity: number;
|
|
119
|
-
refDes: string;
|
|
120
|
-
value?: string | undefined;
|
|
121
|
-
mpn?: string | undefined;
|
|
122
|
-
package?: string | undefined;
|
|
123
|
-
category?: string | undefined;
|
|
124
|
-
supplier?: string | undefined;
|
|
125
|
-
notes?: string | undefined;
|
|
126
|
-
}[];
|
|
127
|
-
thickness?: number | undefined;
|
|
128
|
-
copperWeight?: number | undefined;
|
|
129
|
-
surfaceFinish?: string | undefined;
|
|
130
|
-
solderMask?: string | undefined;
|
|
131
|
-
material?: string | undefined;
|
|
132
|
-
placementSide?: "Top" | "Bottom" | "Both" | undefined;
|
|
133
|
-
stencilType?: string | undefined;
|
|
134
|
-
testingRequired?: boolean | undefined;
|
|
135
|
-
programmingRequired?: boolean | undefined;
|
|
136
|
-
conformalCoating?: boolean | undefined;
|
|
137
|
-
functionalTest?: boolean | undefined;
|
|
138
|
-
}>;
|
|
139
|
-
/**
|
|
140
|
-
* Get PCB assembly quote.
|
|
141
|
-
*/
|
|
142
|
-
getQuote(input: z.infer<typeof AssemblyQuote.inputSchema>): Promise<string>;
|
|
143
|
-
}
|
|
144
|
-
//# sourceMappingURL=AssemblyQuote.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssemblyQuote.d.ts","sourceRoot":"","sources":["../../src/resources/AssemblyQuote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAe;gBAEjB,MAAM,EAAE,YAAY;IAIhC,6CAA6C;IAC7C,MAAM,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;OASjB;IAEH,2CAA2C;IAC3C,MAAM,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiBf;IAEH;;OAEG;IACG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CA+DlF"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* PCB Assembly Quote resource.
|
|
4
|
-
*
|
|
5
|
-
* Tool: assembly_quote
|
|
6
|
-
* Posts PCB specs + BOM and returns PCBA pricing.
|
|
7
|
-
*/
|
|
8
|
-
export class AssemblyQuote {
|
|
9
|
-
client;
|
|
10
|
-
constructor(client) {
|
|
11
|
-
this.client = client;
|
|
12
|
-
}
|
|
13
|
-
/** Zod schema for a single BOM line item. */
|
|
14
|
-
static bomItemSchema = z.object({
|
|
15
|
-
refDes: z.string().describe('Reference designator(s), e.g. "R1,R2,R3"'),
|
|
16
|
-
mpn: z.string().optional().describe('Manufacturer part number'),
|
|
17
|
-
value: z.string().optional().describe('Part value / description'),
|
|
18
|
-
package: z.string().optional().describe('Package / footprint'),
|
|
19
|
-
quantity: z.number().int().positive().describe('Quantity of this part on one board'),
|
|
20
|
-
category: z.string().optional().describe('Part category (resistor, capacitor, IC, etc.)'),
|
|
21
|
-
supplier: z.string().optional().describe('Preferred supplier'),
|
|
22
|
-
notes: z.string().optional().describe('Notes'),
|
|
23
|
-
});
|
|
24
|
-
/** Zod schema for assembly quote input. */
|
|
25
|
-
static inputSchema = z.object({
|
|
26
|
-
length: z.number().positive().describe('Board length in mm'),
|
|
27
|
-
width: z.number().positive().describe('Board width in mm'),
|
|
28
|
-
layers: z.number().int().positive().describe('Number of PCB layers'),
|
|
29
|
-
quantity: z.number().int().positive().describe('Number of boards to assemble'),
|
|
30
|
-
thickness: z.number().positive().optional().describe('Board thickness in mm'),
|
|
31
|
-
copperWeight: z.number().positive().optional().describe('Copper weight in oz'),
|
|
32
|
-
surfaceFinish: z.string().optional().describe('Surface finish'),
|
|
33
|
-
solderMask: z.string().optional().describe('Solder mask color'),
|
|
34
|
-
material: z.string().optional().describe('PCB material'),
|
|
35
|
-
bom: z.array(AssemblyQuote.bomItemSchema).min(1).describe('Bill of materials'),
|
|
36
|
-
placementSide: z.enum(['Top', 'Bottom', 'Both']).optional().describe('SMT placement side'),
|
|
37
|
-
stencilType: z.string().optional().describe('Stencil type'),
|
|
38
|
-
testingRequired: z.boolean().optional().describe('Testing required?'),
|
|
39
|
-
programmingRequired: z.boolean().optional().describe('Programming required?'),
|
|
40
|
-
conformalCoating: z.boolean().optional().describe('Conformal coating required?'),
|
|
41
|
-
functionalTest: z.boolean().optional().describe('Functional testing required?'),
|
|
42
|
-
});
|
|
43
|
-
/**
|
|
44
|
-
* Get PCB assembly quote.
|
|
45
|
-
*/
|
|
46
|
-
async getQuote(input) {
|
|
47
|
-
const payload = {
|
|
48
|
-
pcb: {
|
|
49
|
-
length: input.length,
|
|
50
|
-
width: input.width,
|
|
51
|
-
layers: input.layers,
|
|
52
|
-
quantity: input.quantity,
|
|
53
|
-
thickness: input.thickness,
|
|
54
|
-
copperWeight: input.copperWeight,
|
|
55
|
-
surfaceFinish: input.surfaceFinish,
|
|
56
|
-
solderMask: input.solderMask,
|
|
57
|
-
material: input.material,
|
|
58
|
-
},
|
|
59
|
-
assemblyQuantity: input.quantity,
|
|
60
|
-
bom: input.bom.map((b) => ({
|
|
61
|
-
refDes: b.refDes,
|
|
62
|
-
mpn: b.mpn,
|
|
63
|
-
value: b.value,
|
|
64
|
-
package: b.package,
|
|
65
|
-
quantity: b.quantity,
|
|
66
|
-
category: b.category,
|
|
67
|
-
supplier: b.supplier,
|
|
68
|
-
notes: b.notes,
|
|
69
|
-
})),
|
|
70
|
-
placementSide: input.placementSide,
|
|
71
|
-
stencilType: input.stencilType,
|
|
72
|
-
testingRequired: input.testingRequired,
|
|
73
|
-
programmingRequired: input.programmingRequired,
|
|
74
|
-
conformalCoating: input.conformalCoating,
|
|
75
|
-
functionalTest: input.functionalTest,
|
|
76
|
-
};
|
|
77
|
-
const response = await this.client.post('/api/PCBAssembly/GetPrice', payload);
|
|
78
|
-
if (response.code !== 0) {
|
|
79
|
-
return `PCBWay API error: ${response.message}`;
|
|
80
|
-
}
|
|
81
|
-
if (!response.data) {
|
|
82
|
-
return 'No assembly quote data returned.';
|
|
83
|
-
}
|
|
84
|
-
const d = response.data;
|
|
85
|
-
const lines = [
|
|
86
|
-
`**Assembly Quote (${input.length}×${input.width}mm, ${input.layers}L, qty ${input.quantity})**`,
|
|
87
|
-
`Currency: ${d.currency}`,
|
|
88
|
-
` PCB cost: $${d.pcbCost.toFixed(2)}`,
|
|
89
|
-
` Component cost: $${d.componentCost.toFixed(2)}`,
|
|
90
|
-
` Assembly cost: $${d.assemblyCost.toFixed(2)}`,
|
|
91
|
-
` Stencil cost: $${d.stencilCost.toFixed(2)}`,
|
|
92
|
-
` ─────────────────────────`,
|
|
93
|
-
` **Total: $${d.total.toFixed(2)}**`,
|
|
94
|
-
'',
|
|
95
|
-
...(d.items.length > 0
|
|
96
|
-
? ['Breakdown:', ...d.items.map((i) => ` ${i.description}: $${i.totalPrice.toFixed(2)}`)]
|
|
97
|
-
: []),
|
|
98
|
-
];
|
|
99
|
-
return lines.join('\n');
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=AssemblyQuote.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssemblyQuote.js","sourceRoot":"","sources":["../../src/resources/AssemblyQuote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAChB,MAAM,CAAe;IAE7B,YAAY,MAAo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AC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC1F,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;QAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { PcbWayClient } from '../client.js';
|
|
3
|
-
/**
|
|
4
|
-
* Order Status resource.
|
|
5
|
-
*
|
|
6
|
-
* Tool: order_status
|
|
7
|
-
* Queries the current status and progress of a PCBWay order.
|
|
8
|
-
*/
|
|
9
|
-
export declare class Order {
|
|
10
|
-
private client;
|
|
11
|
-
constructor(client: PcbWayClient);
|
|
12
|
-
static inputSchema: z.ZodObject<{
|
|
13
|
-
orderId: z.ZodString;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
orderId: string;
|
|
16
|
-
}, {
|
|
17
|
-
orderId: string;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Get status of a PCBWay order.
|
|
21
|
-
* This calls the order status endpoint (GET).
|
|
22
|
-
*/
|
|
23
|
-
getStatus(input: z.infer<typeof Order.inputSchema>): Promise<string>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=Order.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../src/resources/Order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C;;;;;GAKG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAe;gBAEjB,MAAM,EAAE,YAAY;IAIhC,MAAM,CAAC,WAAW;;;;;;OAEf;IAEH;;;OAGG;IACG,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAgD3E"}
|
package/dist/resources/Order.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Order Status resource.
|
|
4
|
-
*
|
|
5
|
-
* Tool: order_status
|
|
6
|
-
* Queries the current status and progress of a PCBWay order.
|
|
7
|
-
*/
|
|
8
|
-
export class Order {
|
|
9
|
-
client;
|
|
10
|
-
constructor(client) {
|
|
11
|
-
this.client = client;
|
|
12
|
-
}
|
|
13
|
-
static inputSchema = z.object({
|
|
14
|
-
orderId: z.string().min(1).describe('PCBWay order number'),
|
|
15
|
-
});
|
|
16
|
-
/**
|
|
17
|
-
* Get status of a PCBWay order.
|
|
18
|
-
* This calls the order status endpoint (GET).
|
|
19
|
-
*/
|
|
20
|
-
async getStatus(input) {
|
|
21
|
-
const payload = { orderId: input.orderId };
|
|
22
|
-
const response = await this.client.post('/api/Order/GetStatus', payload);
|
|
23
|
-
if (response.code !== 0) {
|
|
24
|
-
return `PCBWay API error: ${response.message}`;
|
|
25
|
-
}
|
|
26
|
-
if (!response.data) {
|
|
27
|
-
return 'No order data returned.';
|
|
28
|
-
}
|
|
29
|
-
const d = response.data;
|
|
30
|
-
const lines = [
|
|
31
|
-
`**Order ${d.orderId}**`,
|
|
32
|
-
`Status: ${d.statusDescription ?? d.status}`,
|
|
33
|
-
`Progress: ${d.progressPercent ?? 0}%`,
|
|
34
|
-
];
|
|
35
|
-
if (d.estimatedCompletion) {
|
|
36
|
-
lines.push(`Est. completion: ${d.estimatedCompletion}`);
|
|
37
|
-
}
|
|
38
|
-
if (d.trackingNumber) {
|
|
39
|
-
lines.push(`Tracking: ${d.trackingNumber}`);
|
|
40
|
-
}
|
|
41
|
-
if (d.steps && d.steps.length > 0) {
|
|
42
|
-
lines.push('', '**Steps:**');
|
|
43
|
-
for (const step of d.steps) {
|
|
44
|
-
const icon = step.status === 'completed'
|
|
45
|
-
? '✅'
|
|
46
|
-
: step.status === 'in_progress'
|
|
47
|
-
? '🔄'
|
|
48
|
-
: '⏳';
|
|
49
|
-
lines.push(` ${icon} ${step.name} — ${step.status}`);
|
|
50
|
-
if (step.completedAt)
|
|
51
|
-
lines.push(` Done: ${step.completedAt}`);
|
|
52
|
-
if (step.estimatedAt && step.status !== 'completed')
|
|
53
|
-
lines.push(` Est: ${step.estimatedAt}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return lines.join('\n');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=Order.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Order.js","sourceRoot":"","sources":["../../src/resources/Order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;GAKG;AACH,MAAM,OAAO,KAAK;IACR,MAAM,CAAe;IAE7B,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;QAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;KAC3D,CAAC,CAAC;IAEH;;;OAGG;IACH,KAAK,CAAC,SAAS,CAAC,KAAwC;QACtD,MAAM,OAAO,GAAqB,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAE7D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,sBAAsB,EACtB,OAAO,CACR,CAAC;QAEF,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,qBAAqB,QAAQ,CAAC,OAAO,EAAE,CAAC;QACjD,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;Y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AAI,CAAC,gBAAgB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { PcbWayClient } from '../client.js';
|
|
3
|
-
/**
|
|
4
|
-
* Production Status resource.
|
|
5
|
-
*
|
|
6
|
-
* Tool: production_status
|
|
7
|
-
* Returns a simplified view of production progress without
|
|
8
|
-
* the full order overhead — just the status and percentage.
|
|
9
|
-
*/
|
|
10
|
-
export declare class Status {
|
|
11
|
-
private client;
|
|
12
|
-
constructor(client: PcbWayClient);
|
|
13
|
-
static inputSchema: z.ZodObject<{
|
|
14
|
-
orderId: z.ZodString;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
orderId: string;
|
|
17
|
-
}, {
|
|
18
|
-
orderId: string;
|
|
19
|
-
}>;
|
|
20
|
-
/**
|
|
21
|
-
* Get simplified production status.
|
|
22
|
-
* Shares the same backend endpoint as Order but returns
|
|
23
|
-
* a terse summary suitable for quick polling.
|
|
24
|
-
*/
|
|
25
|
-
getStatus(input: z.infer<typeof Status.inputSchema>): Promise<string>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=Status.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../src/resources/Status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C;;;;;;GAMG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAe;gBAEjB,MAAM,EAAE,YAAY;IAIhC,MAAM,CAAC,WAAW;;;;;;OAEf;IAEH;;;;OAIG;IACG,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAkC5E"}
|
package/dist/resources/Status.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Production Status resource.
|
|
4
|
-
*
|
|
5
|
-
* Tool: production_status
|
|
6
|
-
* Returns a simplified view of production progress without
|
|
7
|
-
* the full order overhead — just the status and percentage.
|
|
8
|
-
*/
|
|
9
|
-
export class Status {
|
|
10
|
-
client;
|
|
11
|
-
constructor(client) {
|
|
12
|
-
this.client = client;
|
|
13
|
-
}
|
|
14
|
-
static inputSchema = z.object({
|
|
15
|
-
orderId: z.string().min(1).describe('PCBWay order number'),
|
|
16
|
-
});
|
|
17
|
-
/**
|
|
18
|
-
* Get simplified production status.
|
|
19
|
-
* Shares the same backend endpoint as Order but returns
|
|
20
|
-
* a terse summary suitable for quick polling.
|
|
21
|
-
*/
|
|
22
|
-
async getStatus(input) {
|
|
23
|
-
const response = await this.client.post('/api/Order/GetStatus', { orderId: input.orderId });
|
|
24
|
-
if (response.code !== 0) {
|
|
25
|
-
return `PCBWay API error: ${response.message}`;
|
|
26
|
-
}
|
|
27
|
-
if (!response.data) {
|
|
28
|
-
return 'No status data returned.';
|
|
29
|
-
}
|
|
30
|
-
const d = response.data;
|
|
31
|
-
const pct = d.progressPercent ?? 0;
|
|
32
|
-
// Build a compact progress bar
|
|
33
|
-
const barWidth = 20;
|
|
34
|
-
const filled = Math.round((pct / 100) * barWidth);
|
|
35
|
-
const bar = '█'.repeat(filled) + '░'.repeat(barWidth - filled);
|
|
36
|
-
const lines = [
|
|
37
|
-
`**${d.orderId}**`,
|
|
38
|
-
`[${bar}] ${pct}%`,
|
|
39
|
-
`Status: ${d.statusDescription ?? d.status}`,
|
|
40
|
-
];
|
|
41
|
-
if (d.estimatedCompletion) {
|
|
42
|
-
lines.push(`Est. completion: ${d.estimatedCompletion}`);
|
|
43
|
-
}
|
|
44
|
-
return lines.join('\n');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=Status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Status.js","sourceRoot":"","sources":["../../src/resources/Status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACT,MAAM,CAAe;IAE7B,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;QAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;KAC3D,CAAC,CAAC;IAEH;;;;OAIG;IACH,KAAK,CAAC,SAAS,CAAC,KAAyC;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,sBAAsB,EACtB,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAC3B,CAAC;QAEF,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,qBAAqB,QAAQ,CAAC,OAAO,EAAE,CAAC;QACjD,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnB,OAAO,0BAA0B,CAAC;QACpC,CAAC;QAED,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;QACxB,MAAM,GAAG,GAAG,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC;QAEnC,+BAA+B;QAC/B,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC;QAClD,MAAM,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